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

Function TestGet

parser_test.go:1377–1388  ·  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

1375// 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
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=T => TRUE
1377func TestGet(t *testing.T) {
1378 runGetTests(t, "Get()", getTests,
1379 func(test GetTest) (value interface{}, dataType ValueType, err error) {
1380 value, dataType, _, err = Get([]byte(test.json), test.path...)
1381 return
1382 },
1383 func(test GetTest, value interface{}) (bool, interface{}) {
1384 expected := []byte(test.data.(string))
1385 return bytes.Equal(expected, value.([]byte)), expected
1386 },
1387 )
1388}
1389
1390// Verifies: SYS-REQ-016 [boundary]
1391// 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