(t *testing.T)
| 142 | } |
| 143 | |
| 144 | func TestOverlap(t *testing.T) { |
| 145 | t.Parallel() |
| 146 | |
| 147 | assertSetOverlaps(t, true, []int{1, 2, 3, 4, 5}, []int{1, 2, 3, 4, 5}) |
| 148 | assertSetOverlaps(t, true, []int{10}, []int{10}) |
| 149 | |
| 150 | assertSetOverlaps(t, false, []int{1, 2, 3, 4, 5}, []int{6, 7, 8, 9}) |
| 151 | assertSetOverlaps(t, false, []int{1, 2, 3, 4, 5}, []int{}) |
| 152 | assertSetOverlaps(t, false, []int{}, []int{}) |
| 153 | |
| 154 | assertSetOverlaps(t, true, []string{"hello", "world", "foo", "bar", "baz"}, []string{"hello", "world", "baz"}) |
| 155 | assertSetOverlaps(t, true, |
| 156 | []uuid.UUID{uuid.New(), uuid.MustParse("c7c6686d-a93c-4df2-bef9-5f837e9a33d5"), uuid.MustParse("8f3b3e0b-2c3f-46a5-a365-fd5b62bd8818")}, |
| 157 | []uuid.UUID{uuid.MustParse("c7c6686d-a93c-4df2-bef9-5f837e9a33d5")}, |
| 158 | ) |
| 159 | } |
| 160 | |
| 161 | func assertSetOverlaps[T comparable](t *testing.T, overlap bool, a []T, b []T) { |
| 162 | t.Helper() |
nothing calls this directly
no test coverage detected