...
1 package cli
2
3 import "testing"
4
5 var lexicographicLessTests = []struct {
6 i string
7 j string
8 expected bool
9 }{
10 {"", "a", true},
11 {"a", "", false},
12 {"a", "a", false},
13 {"a", "A", false},
14 {"A", "a", true},
15 {"aa", "a", false},
16 {"a", "aa", true},
17 {"a", "b", true},
18 {"a", "B", true},
19 {"A", "b", true},
20 {"A", "B", true},
21 }
22
23 func TestLexicographicLess(t *testing.T) {
24 for _, test := range lexicographicLessTests {
25 actual := lexicographicLess(test.i, test.j)
26 if test.expected != actual {
27 t.Errorf(`expected string "%s" to come before "%s"`, test.i, test.j)
28 }
29 }
30 }
31
View as plain text