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

Function TestSetPathBeyondEOF

deep_spec_test.go:348–359  ·  view source on GitHub ↗

Verifies: SYS-REQ-068 [boundary] Set with path pointing beyond EOF shall return error, not panic.

(t *testing.T)

Source from the content-addressed store, hash-verified

346// Verifies: SYS-REQ-068 [boundary]
347// Set with path pointing beyond EOF shall return error, not panic.
348func TestSetPathBeyondEOF(t *testing.T) {
349 func() {
350 defer func() {
351 if r := recover(); r != nil {
352 t.Fatalf("Set with path beyond EOF panicked: %v", r)
353 }
354 }()
355 _, err := Set([]byte(`{"a":1`), []byte(`"v"`), "a", "deep", "path")
356 // We accept error or non-panic behavior
357 _ = err
358 }()
359}
360
361// Verifies: SYS-REQ-069 [boundary]
362// Set with multi-level path where intermediate levels exist but leaf does not.

Callers

nothing calls this directly

Calls 1

SetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…