MCPcopy Index your code
hub / github.com/adam-hanna/arrayOperations / TestIntersect

Function TestIntersect

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

Source from the content-addressed store, hash-verified

176}
177
178func TestIntersect(t *testing.T) {
179 for i, tt := range []testIntersect[int]{
180 testIntersect[int]{
181 input: testIntersectInput[int]{
182 []int{1, 2, 3, 3, 4},
183 []int{1, 2, 4},
184 []int{1, 3, 4},
185 },
186 output: []int{1, 4},
187 },
188 } {
189 t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
190 actual := Intersect(tt.input...)
191
192 if !isEqual(actual, tt.output) {
193 t.Errorf("expected: %v %T, received: %v %T", tt.output, tt.output, actual, actual)
194 }
195 })
196 }
197}
198
199type testUnionInput[T comparable] [][]T
200type testUnionOutput[T comparable] []T

Callers

nothing calls this directly

Calls 2

IntersectFunction · 0.85
isEqualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…