| 8 | ) |
| 9 | |
| 10 | func TestVersionCompare(t *testing.T) { |
| 11 | if V0_8_2_0.IsAtLeast(V0_8_2_1) { |
| 12 | t.Error("0.8.2.0 >= 0.8.2.1") |
| 13 | } |
| 14 | if !V0_8_2_1.IsAtLeast(V0_8_2_0) { |
| 15 | t.Error("! 0.8.2.1 >= 0.8.2.0") |
| 16 | } |
| 17 | if !V0_8_2_0.IsAtLeast(V0_8_2_0) { |
| 18 | t.Error("! 0.8.2.0 >= 0.8.2.0") |
| 19 | } |
| 20 | if !V0_9_0_0.IsAtLeast(V0_8_2_1) { |
| 21 | t.Error("! 0.9.0.0 >= 0.8.2.1") |
| 22 | } |
| 23 | if V0_8_2_1.IsAtLeast(V0_10_0_0) { |
| 24 | t.Error("0.8.2.1 >= 0.10.0.0") |
| 25 | } |
| 26 | if !V1_0_0_0.IsAtLeast(V0_9_0_0) { |
| 27 | t.Error("! 1.0.0.0 >= 0.9.0.0") |
| 28 | } |
| 29 | if V0_9_0_0.IsAtLeast(V1_0_0_0) { |
| 30 | t.Error("0.9.0.0 >= 1.0.0.0") |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func TestVersionParsing(t *testing.T) { |
| 35 | validVersions := []string{ |