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

Function TestGetNilSafety

obligation_property_test.go:280–295  ·  view source on GitHub ↗

============================================================================= Nil safety tests ============================================================================= Verifies: SYS-REQ-088 MCDC SYS-REQ-088: get_input_is_nil=T, get_returns_safe_result_for_nil=T => TRUE

(t *testing.T)

Source from the content-addressed store, hash-verified

278// Verifies: SYS-REQ-088
279// MCDC SYS-REQ-088: get_input_is_nil=T, get_returns_safe_result_for_nil=T => TRUE
280func TestGetNilSafety(t *testing.T) {
281 defer func() {
282 if r := recover(); r != nil {
283 t.Fatalf("Get(nil) panicked: %v", r)
284 }
285 }()
286
287 _, _, _, err := Get(nil, "key")
288 if err == nil {
289 t.Logf("Get(nil, 'key') returned no error (acceptable if not-found)")
290 }
291
292 // Also test nil with no keys
293 _, _, _, err = Get(nil)
294 _ = err
295}
296
297// Verifies: SYS-REQ-091
298// MCDC SYS-REQ-091: getstring_input_is_nil=T, getstring_returns_safe_result_for_nil=T => TRUE

Callers

nothing calls this directly

Calls 1

GetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…