(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestCommonPrefixComponents(t *testing.T) { |
| 80 | for _, tc := range []struct { |
| 81 | components []string |
| 82 | target string |
| 83 | expected int |
| 84 | }{ |
| 85 | { |
| 86 | components: []string{"foo"}, |
| 87 | target: "foo/bar", |
| 88 | expected: 1, |
| 89 | }, |
| 90 | { |
| 91 | components: []string{"bar"}, |
| 92 | target: "foo/bar", |
| 93 | expected: 0, |
| 94 | }, |
| 95 | { |
| 96 | components: []string{"foo", "bar"}, |
| 97 | target: "foo/bar", |
| 98 | expected: 2, |
| 99 | }, |
| 100 | } { |
| 101 | if got := commonPrefixComponents(tc.components, tc.target); !reflect.DeepEqual(got, tc.expected) { |
| 102 | t.Fatalf("expected %v, but got %v", tc.expected, got) |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func TestSelectRepositoryMountCandidate(t *testing.T) { |
| 108 | for _, tc := range []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…