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

Function TestGet

parser_test.go:1359–1370  ·  view source on GitHub ↗

Verifies: SYS-REQ-001 [example] 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, returns_existing_path_lookup_r

(t *testing.T)

Source from the content-addressed store, hash-verified

1357// 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
1358// 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
1359func TestGet(t *testing.T) {
1360 runGetTests(t, "Get()", getTests,
1361 func(test GetTest) (value interface{}, dataType ValueType, err error) {
1362 value, dataType, _, err = Get([]byte(test.json), test.path...)
1363 return
1364 },
1365 func(test GetTest, value interface{}) (bool, interface{}) {
1366 expected := []byte(test.data.(string))
1367 return bytes.Equal(expected, value.([]byte)), expected
1368 },
1369 )
1370}
1371
1372// Verifies: SYS-REQ-016 [boundary]
1373// 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…