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

Function TestArray_IsEmpty

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

Source from the content-addressed store, hash-verified

367}
368
369func TestArray_IsEmpty(t *testing.T) {
370 cases := []struct {
371 name string
372 value []interface{}
373 wantEmpty chainResult
374 }{
375 {
376 name: "empty slice",
377 value: []interface{}{},
378 wantEmpty: success,
379 },
380 {
381 name: "one empty element",
382 value: []interface{}{""},
383 wantEmpty: failure,
384 },
385 }
386
387 for _, tc := range cases {
388 t.Run(tc.name, func(t *testing.T) {
389 reporter := newMockReporter(t)
390
391 NewArray(reporter, tc.value).IsEmpty().
392 chain.assert(t, tc.wantEmpty)
393
394 NewArray(reporter, tc.value).NotEmpty().
395 chain.assert(t, !tc.wantEmpty)
396 })
397 }
398}
399
400func TestArray_IsEqual(t *testing.T) {
401 t.Run("basic", func(t *testing.T) {

Callers

nothing calls this directly

Calls 5

newMockReporterFunction · 0.85
NewArrayFunction · 0.85
assertMethod · 0.80
IsEmptyMethod · 0.45
NotEmptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…