| 1 | package cli |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/assert" |
| 7 | ) |
| 8 | |
| 9 | var lexicographicLessTests = []struct { |
| 10 | i string |
| 11 | j string |
| 12 | expected bool |
| 13 | }{ |
| 14 | {"", "a", true}, |
| 15 | {"a", "", false}, |
| 16 | {"a", "a", false}, |
| 17 | {"a", "A", false}, |
| 18 | {"A", "a", true}, |
| 19 | {"aa", "a", false}, |
| 20 | {"a", "aa", true}, |
| 21 | {"a", "b", true}, |
| 22 | {"a", "B", true}, |
| 23 | {"A", "b", true}, |
| 24 | {"A", "B", true}, |
| 25 | } |
| 26 | |
| 27 | func TestLexicographicLess(t *testing.T) { |
| 28 | for _, test := range lexicographicLessTests { |
| 29 | actual := lexicographicLess(test.i, test.j) |
| 30 | assert.Equal(t, test.expected, actual) |
| 31 | } |
| 32 | } |