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

Function TestDifference

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

Source from the content-addressed store, hash-verified

232}
233
234func TestDifference(t *testing.T) {
235 for i, tt := range []testDifference[int]{
236 testDifference[int]{
237 input: testDifferenceInput[int]{
238 []int{1, 2, 3, 3, 4},
239 []int{1, 2, 5},
240 []int{1, 3, 6},
241 },
242 output: []int{4, 5, 6},
243 },
244 //testDifference[interface{}]{
245 //input: testDifferenceInput[string]{
246 //[]string{"1", "2", "3", "3", "4"},
247 //[]string{"1", "2", "5"},
248 //[]string{"1", "3", "6"},
249 //},
250 //output: []string{"4", "5", "6"},
251 //},
252 } {
253 t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
254 actual := Difference(tt.input...)
255
256 if !isEqual(actual, tt.output) {
257 t.Errorf("expected: %v %T, received: %v %T", tt.output, tt.output, actual, actual)
258 }
259 })
260 }
261}

Callers

nothing calls this directly

Calls 2

DifferenceFunction · 0.85
isEqualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…