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

Function TestPanickingErrors

parser_error_test.go:30–46  ·  view source on GitHub ↗

Verifies: SYS-REQ-001 [malformed] MCDC SYS-REQ-001: N/A Verifies: SYS-REQ-008 [malformed] MCDC SYS-REQ-008: eachkey_callback_receives_found_values=F, eachkey_completes_requested_scan=F, eachkey_malformed_input_returns_error=T, missing_multipath_request_does_not_emit_callback=F, multipath_requests_ar

(t *testing.T)

Source from the content-addressed store, hash-verified

28// Verifies: SYS-REQ-008 [malformed]
29// MCDC SYS-REQ-008: eachkey_callback_receives_found_values=F, eachkey_completes_requested_scan=F, eachkey_malformed_input_returns_error=T, missing_multipath_request_does_not_emit_callback=F, multipath_requests_are_provided=T => TRUE
30func TestPanickingErrors(t *testing.T) {
31 if err := testIter([]byte(`{"test":`)); err == nil {
32 t.Error("Expected error...")
33 }
34
35 if err := testIter([]byte(`{"test":0}some":[{"these":[{"keys":"some"}]}]}some"}]}],"please":"some"}`)); err == nil {
36 t.Error("Expected error...")
37 }
38
39 if _, _, _, err := Get([]byte(`{"test":`), "test"); err == nil {
40 t.Error("Expected error...")
41 }
42
43 if _, _, _, err := Get([]byte(`{"some":0}some":[{"some":[{"some":"some"}]}]}some"}]}],"some":"some"}`), "x"); err == nil {
44 t.Error("Expected error...")
45 }
46}
47
48// Verifies: SYS-REQ-008 [boundary]
49// MCDC SYS-REQ-008: eachkey_callback_receives_found_values=F, eachkey_completes_requested_scan=F, eachkey_malformed_input_returns_error=F, missing_multipath_request_does_not_emit_callback=F, multipath_requests_are_provided=F => TRUE

Callers

nothing calls this directly

Calls 2

testIterFunction · 0.85
GetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…