MCPcopy Index your code
hub / github.com/coder/coder / assertSetOverlaps

Function assertSetOverlaps

coderd/util/slice/slice_test.go:161–171  ·  view source on GitHub ↗
(t *testing.T, overlap bool, a []T, b []T)

Source from the content-addressed store, hash-verified

159}
160
161func assertSetOverlaps[T comparable](t *testing.T, overlap bool, a []T, b []T) {
162 t.Helper()
163 for _, e := range a {
164 require.True(t, slice.Overlap(a, []T{e}), "elements in set should overlap with itself")
165 }
166 for _, e := range b {
167 require.True(t, slice.Overlap(b, []T{e}), "elements in set should overlap with itself")
168 }
169
170 require.Equal(t, overlap, slice.Overlap(a, b))
171}
172
173func assertSetContains[T comparable](t *testing.T, set []T, in []T, out []T) {
174 t.Helper()

Callers 1

TestOverlapFunction · 0.85

Calls 3

OverlapFunction · 0.92
HelperMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected