MCPcopy Create free account
hub / github.com/buger/jsonparser / TestGetSlice

Function TestGetSlice

parser_test.go:1616–1627  ·  view source on GitHub ↗

Verifies: SYS-REQ-001 [example] MCDC SYS-REQ-001: N/A

(t *testing.T)

Source from the content-addressed store, hash-verified

1614// Verifies: SYS-REQ-001 [example]
1615// MCDC SYS-REQ-001: N/A
1616func TestGetSlice(t *testing.T) {
1617 runGetTests(t, "Get()-for-arrays", getArrayTests,
1618 func(test GetTest) (value interface{}, dataType ValueType, err error) {
1619 value, dataType, _, err = Get([]byte(test.json), test.path...)
1620 return
1621 },
1622 func(test GetTest, value interface{}) (bool, interface{}) {
1623 expected := test.data.([]string)
1624 return reflect.DeepEqual(expected, toStringArray(value.([]byte))), expected
1625 },
1626 )
1627}
1628
1629// Verifies: SYS-REQ-006 [example]
1630// STK-REQ-004:AC-1:acceptance

Callers

nothing calls this directly

Calls 3

runGetTestsFunction · 0.85
GetFunction · 0.85
toStringArrayFunction · 0.85

Tested by

no test coverage detected