File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed
tools/setup-envtest/versions Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ var _ = Describe("Concrete", func() {
3636 Describe ("when ordering relative to other versions" , func () {
3737 ver1163 := Concrete {Major : 1 , Minor : 16 , Patch : 3 }
3838 Specify ("newer patch should be newer" , func () {
39- Expect (ver1163 .NewerThan (Concrete {Major : 1 , Minor : 16 })).To (BeTrue ( ))
39+ Expect (ver1163 .Compare (Concrete {Major : 1 , Minor : 16 })).To (Equal ( 1 ))
4040 })
4141 Specify ("newer minor should be newer" , func () {
42- Expect (ver1163 .NewerThan (Concrete {Major : 1 , Minor : 15 , Patch : 3 })).To (BeTrue ( ))
42+ Expect (ver1163 .Compare (Concrete {Major : 1 , Minor : 15 , Patch : 3 })).To (Equal ( 1 ))
4343 })
4444 Specify ("newer major should be newer" , func () {
45- Expect (ver1163 .NewerThan (Concrete {Major : 0 , Minor : 16 , Patch : 3 })).To (BeTrue ( ))
45+ Expect (ver1163 .Compare (Concrete {Major : 0 , Minor : 16 , Patch : 3 })).To (Equal ( 1 ))
4646 })
4747 })
4848})
Original file line number Diff line number Diff line change @@ -47,17 +47,6 @@ func (c Concrete) Compare(other Concrete) int {
4747 return IntCompare (c .Patch , other .Patch )
4848}
4949
50- // NewerThan checks if the given other version is newer than this one.
51- func (c Concrete ) NewerThan (other Concrete ) bool {
52- if c .Major != other .Major {
53- return c .Major > other .Major
54- }
55- if c .Minor != other .Minor {
56- return c .Minor > other .Minor
57- }
58- return c .Patch > other .Patch
59- }
60-
6150// Matches checks if this version is equal to the other one.
6251func (c Concrete ) Matches (other Concrete ) bool {
6352 return c == other
You can’t perform that action at this time.
0 commit comments