MCPcopy
hub / github.com/IBM/sarama / TestVersionCompare

Function TestVersionCompare

utils_test.go:10–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func 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
34func TestVersionParsing(t *testing.T) {
35 validVersions := []string{

Callers

nothing calls this directly

Calls 2

IsAtLeastMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected