MCPcopy
hub / github.com/buger/jsonparser / TestGetSlice

Function TestGetSlice

parser_test.go:1593–1604  ·  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

1591// Verifies: SYS-REQ-001 [example]
1592// MCDC SYS-REQ-001: N/A
1593func TestGetSlice(t *testing.T) {
1594 runGetTests(t, "Get()-for-arrays", getArrayTests,
1595 func(test GetTest) (value interface{}, dataType ValueType, err error) {
1596 value, dataType, _, err = Get([]byte(test.json), test.path...)
1597 return
1598 },
1599 func(test GetTest, value interface{}) (bool, interface{}) {
1600 expected := test.data.([]string)
1601 return reflect.DeepEqual(expected, toStringArray(value.([]byte))), expected
1602 },
1603 )
1604}
1605
1606// Verifies: SYS-REQ-006 [example]
1607// MCDC SYS-REQ-006: addressed_array_is_empty=F, addressed_array_is_well_formed=T, array_callback_receives_elements_in_order=F => FALSE

Callers

nothing calls this directly

Calls 3

runGetTestsFunction · 0.85
GetFunction · 0.85
toStringArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…