(t *testing.T)
| 35 | ) |
| 36 | |
| 37 | func TestLongestCommonPrefix(t *testing.T) { |
| 38 | tcases := []struct { |
| 39 | in []string |
| 40 | expected string |
| 41 | }{ |
| 42 | {[]string{}, ""}, |
| 43 | {[]string{"foo"}, "foo"}, |
| 44 | {[]string{"foo", "bar"}, ""}, |
| 45 | {[]string{"foo", "foo"}, "foo"}, |
| 46 | {[]string{"foo", "foobar"}, "foo"}, |
| 47 | {[]string{"foo", "", "foobar"}, ""}, |
| 48 | } |
| 49 | |
| 50 | for i, tc := range tcases { |
| 51 | if got := longestCommonPrefix(tc.in); got != tc.expected { |
| 52 | t.Fatalf("[%d case] expected (%s), but got (%s)", i+1, tc.expected, got) |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func TestCompactLowerdirOption(t *testing.T) { |
| 58 | tcases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…