MCPcopy Index your code
hub / github.com/gavv/httpexpect / TestArray_IsEqual

Function TestArray_IsEqual

array_test.go:400–524  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

398}
399
400func TestArray_IsEqual(t *testing.T) {
401 t.Run("basic", func(t *testing.T) {
402 cases := []struct {
403 name string
404 value []interface{}
405 testValue interface{}
406 wantEqual chainResult
407 }{
408 {
409 name: "empty array vs empty array",
410 value: []interface{}{},
411 testValue: []interface{}{},
412 wantEqual: success,
413 },
414 {
415 name: "one empty element vs one empty elemenent",
416 value: []interface{}{""},
417 testValue: []interface{}{""},
418 wantEqual: success,
419 },
420 {
421 name: "array vs empty array",
422 value: []interface{}{"foo", "bar"},
423 testValue: []interface{}{},
424 wantEqual: failure,
425 },
426 {
427 name: "subset",
428 value: []interface{}{"foo", "bar"},
429 testValue: []interface{}{"foo"},
430 wantEqual: failure,
431 },
432 {
433 name: "reordered",
434 value: []interface{}{"foo", "bar"},
435 testValue: []interface{}{"bar", "foo"},
436 wantEqual: failure,
437 },
438 {
439 name: "strings",
440 value: []interface{}{"foo", "bar"},
441 testValue: []interface{}{"foo", "bar"},
442 wantEqual: success,
443 },
444 {
445 name: "numbers",
446 value: []interface{}{123, 456},
447 testValue: []interface{}{123, 456},
448 wantEqual: success,
449 },
450 }
451
452 for _, tc := range cases {
453 t.Run(tc.name, func(t *testing.T) {
454 reporter := newMockReporter(t)
455
456 NewArray(reporter, tc.value).IsEqual(tc.testValue).
457 chain.assert(t, tc.wantEqual)

Callers

nothing calls this directly

Calls 6

newMockReporterFunction · 0.85
NewArrayFunction · 0.85
assertMethod · 0.80
myIntTypeAlias · 0.70
IsEqualMethod · 0.45
NotEqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…