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

Function TestArray_HasValue

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

Source from the content-addressed store, hash-verified

1375}
1376
1377func TestArray_HasValue(t *testing.T) {
1378 t.Run("basic", func(t *testing.T) {
1379 cases := []struct {
1380 name string
1381 array []interface{}
1382 index int
1383 value interface{}
1384 wantHasValue chainResult
1385 wantNotHasValue chainResult
1386 }{
1387 {
1388 name: "index zero check",
1389 array: []interface{}{
1390 123,
1391 []interface{}{"456", 789},
1392 map[string]interface{}{
1393 "a": "b",
1394 },
1395 },
1396 index: 0,
1397 value: 123,
1398 wantHasValue: success,
1399 wantNotHasValue: failure,
1400 },
1401 {
1402 name: "index one check",
1403 array: []interface{}{
1404 123,
1405 []interface{}{"456", 789},
1406 map[string]interface{}{
1407 "a": "b",
1408 },
1409 },
1410 index: 1,
1411 value: []interface{}{"456", 789},
1412 wantHasValue: success,
1413 wantNotHasValue: failure,
1414 },
1415 {
1416 name: "index two check",
1417 array: []interface{}{
1418 123,
1419 []interface{}{"456", 789},
1420 map[string]interface{}{
1421 "a": "b",
1422 },
1423 },
1424 index: 2,
1425 value: map[string]interface{}{"a": "b"},
1426 wantHasValue: success,
1427 wantNotHasValue: failure,
1428 },
1429 {
1430 name: "out of bounds check",
1431 array: []interface{}{
1432 123,
1433 []interface{}{"456", 789},
1434 map[string]interface{}{

Callers

nothing calls this directly

Calls 6

newMockReporterFunction · 0.85
NewArrayFunction · 0.85
assertMethod · 0.80
myIntTypeAlias · 0.70
HasValueMethod · 0.45
NotHasValueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…