MCPcopy Create free account
hub / github.com/adam-hanna/arrayOperations / TestDistinct

Function TestDistinct

arrayOperations_unit_test.go:152–169  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150}
151
152func TestDistinct(t *testing.T) {
153 for i, tt := range []testDistinct[int]{
154 testDistinct[int]{
155 input: testDistinctInput[int]{
156 []int{1, 2, 3, 3, 4},
157 },
158 output: []int{1, 2, 3, 4},
159 },
160 } {
161 t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
162 actual := Distinct(tt.input...)
163
164 if !isEqual(actual, tt.output) {
165 t.Errorf("expected: %v %T, received: %v %T", tt.output, tt.output, actual, actual)
166 }
167 })
168 }
169}
170
171type testIntersectInput[T comparable] [][]T
172type testIntersectOutput[T comparable] []T

Callers

nothing calls this directly

Calls 2

DistinctFunction · 0.85
isEqualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…