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

Function TestGetStringTruncatedEscape

deep_spec_test.go:667–673  ·  view source on GitHub ↗

Verifies: SYS-REQ-072 [malformed] GetString with truncated escape in value shall return error.

(t *testing.T)

Source from the content-addressed store, hash-verified

665// Verifies: SYS-REQ-072 [malformed]
666// GetString with truncated escape in value shall return error.
667func TestGetStringTruncatedEscape(t *testing.T) {
668 // Value has a truncated unicode escape
669 _, err := GetString([]byte(`{"a":"hello\\uD800"}`), "a")
670 // The raw value from Get will contain the escape. ParseString should handle it.
671 // If the escape is invalid, we expect an error.
672 _ = err // Accept either error or success depending on how the parser handles this
673}
674
675// Verifies: SYS-REQ-073 [boundary]
676// GetString on non-string value shall return a type-mismatch error.

Callers

nothing calls this directly

Calls 1

GetStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…