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

Function TestUnion

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

Source from the content-addressed store, hash-verified

204}
205
206func TestUnion(t *testing.T) {
207 for i, tt := range []testUnion[int]{
208 testUnion[int]{
209 input: testUnionInput[int]{
210 []int{1, 2, 3, 3, 4},
211 []int{1, 2, 4, 5},
212 []int{1, 3, 4, 6},
213 },
214 output: []int{1, 2, 3, 4, 5, 6},
215 },
216 } {
217 t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
218 actual := Union(tt.input...)
219
220 if !isEqual(actual, tt.output) {
221 t.Errorf("expected: %v %T, received: %v %T", tt.output, tt.output, actual, actual)
222 }
223 })
224 }
225}
226
227type testDifferenceInput[T comparable] [][]T
228type testDifferenceOutput[T comparable] []T

Callers

nothing calls this directly

Calls 2

UnionFunction · 0.85
isEqualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…