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

Function TestGet

parser_test.go:1378–1389  ·  view source on GitHub ↗

Verifies: SYS-REQ-001 [example] STK-REQ-001:AC-1:acceptance MCDC SYS-REQ-001: addressed_path_exists=F, json_input_is_well_formed=T, key_path_is_provided=T, returns_existing_path_lookup_result=F => TRUE MCDC SYS-REQ-001: addressed_path_exists=T, json_input_is_well_formed=F, key_path_is_provided=T, re

(t *testing.T)

Source from the content-addressed store, hash-verified

1376// MCDC SYS-REQ-001: addressed_path_exists=T, json_input_is_well_formed=T, key_path_is_provided=T, returns_existing_path_lookup_result=F => FALSE
1377// MCDC SYS-REQ-001: addressed_path_exists=T, json_input_is_well_formed=T, key_path_is_provided=T, returns_existing_path_lookup_result=T => TRUE
1378func TestGet(t *testing.T) {
1379 runGetTests(t, "Get()", getTests,
1380 func(test GetTest) (value interface{}, dataType ValueType, err error) {
1381 value, dataType, _, err = Get([]byte(test.json), test.path...)
1382 return
1383 },
1384 func(test GetTest, value interface{}) (bool, interface{}) {
1385 expected := []byte(test.data.(string))
1386 return bytes.Equal(expected, value.([]byte)), expected
1387 },
1388 )
1389}
1390
1391// Verifies: SYS-REQ-016 [boundary]
1392// MCDC SYS-REQ-016: N/A

Callers

nothing calls this directly

Calls 2

runGetTestsFunction · 0.85
GetFunction · 0.85

Tested by

no test coverage detected