MCPcopy Index your code
hub / github.com/buger/jsonparser / TestGetUnsafeStringTruncatedValue

Function TestGetUnsafeStringTruncatedValue

deep_spec_test.go:807–818  ·  view source on GitHub ↗

Verifies: SYS-REQ-082 [malformed] GetUnsafeString on truncated-at-value-boundary input shall return error.

(t *testing.T)

Source from the content-addressed store, hash-verified

805// Verifies: SYS-REQ-082 [malformed]
806// GetUnsafeString on truncated-at-value-boundary input shall return error.
807func TestGetUnsafeStringTruncatedValue(t *testing.T) {
808 func() {
809 defer func() {
810 if r := recover(); r != nil {
811 t.Fatalf("GetUnsafeString on truncated input panicked: %v", r)
812 }
813 }()
814 _, err := GetUnsafeString([]byte(`{"a":1`), "a")
815 // Accept error or best-effort result, as long as no panic
816 _ = err
817 }()
818}
819
820// =============================================================================
821// ArrayEach truncated at value boundary (SYS-REQ-083)

Callers

nothing calls this directly

Calls 1

GetUnsafeStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…