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

Function TestGetSlice

parser_test.go:1617–1628  ·  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

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