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

Function assertSetContains

coderd/util/slice/slice_test.go:173–184  ·  view source on GitHub ↗
(t *testing.T, set []T, in []T, out []T)

Source from the content-addressed store, hash-verified

171}
172
173func assertSetContains[T comparable](t *testing.T, set []T, in []T, out []T) {
174 t.Helper()
175 for _, e := range set {
176 require.True(t, slice.Contains(set, e), "elements in set should be in the set")
177 }
178 for _, e := range in {
179 require.True(t, slice.Contains(set, e), "expect element in set")
180 }
181 for _, e := range out {
182 require.False(t, slice.Contains(set, e), "expect element in set")
183 }
184}
185
186func TestAscending(t *testing.T) {
187 t.Parallel()

Callers 1

TestContainsFunction · 0.85

Calls 2

ContainsFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected