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

Function assertSameElements

coderd/util/slice/slice_test.go:33–40  ·  view source on GitHub ↗
(t *testing.T, elements []T)

Source from the content-addressed store, hash-verified

31}
32
33func assertSameElements[T comparable](t *testing.T, elements []T) {
34 cpy := make([]T, len(elements))
35 copy(cpy, elements)
36 rand.Shuffle(len(cpy), func(i, j int) {
37 cpy[i], cpy[j] = cpy[j], cpy[i]
38 })
39 assert.True(t, slice.SameElements(elements, cpy))
40}
41
42func TestUnique(t *testing.T) {
43 t.Parallel()

Callers 1

TestSameElementsFunction · 0.85

Calls 1

SameElementsFunction · 0.92

Tested by

no test coverage detected