MCPcopy Create free account
hub / github.com/buger/jsonparser / TestGetStringTruncatedEscape

Function TestGetStringTruncatedEscape

deep_spec_test.go:681–687  ·  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

679// Verifies: SYS-REQ-072 [malformed]
680// GetString with truncated escape in value shall return error.
681func TestGetStringTruncatedEscape(t *testing.T) {
682 // Value has a truncated unicode escape
683 _, err := GetString([]byte(`{"a":"hello\\uD800"}`), "a")
684 // The raw value from Get will contain the escape. ParseString should handle it.
685 // If the escape is invalid, we expect an error.
686 _ = err // Accept either error or success depending on how the parser handles this
687}
688
689// Verifies: SYS-REQ-073 [boundary]
690// 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