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

Function TestUnescapeValidSurrogatePairStillWorks

escape_test.go:281–289  ·  view source on GitHub ↗

Verifies: SYS-REQ-014 [happy-path] — a valid UTF-16 surrogate pair must still combine into the supplementary-plane code point (regression guard).

(t *testing.T)

Source from the content-addressed store, hash-verified

279// Verifies: SYS-REQ-014 [happy-path] — a valid UTF-16 surrogate pair must
280// still combine into the supplementary-plane code point (regression guard).
281func TestUnescapeValidSurrogatePairStillWorks(t *testing.T) {
282 out, err := Unescape([]byte(`\uD800\uDC00`), nil)
283 if err != nil {
284 t.Fatalf("Unescape(`\\uD800\\uDC00`) returned error %v; expected U+10000", err)
285 }
286 if want, got := "\U00010000", string(out); got != want {
287 t.Errorf("Unescape(`\\uD800\\uDC00`) = %q; expected %q", got, want)
288 }
289}
290
291// Verifies: SYS-REQ-014 [differential] — for a corpus of lone-surrogate
292// inputs, ParseString must byte-match encoding/json.Unmarshal (the oracle

Callers

nothing calls this directly

Calls 1

UnescapeFunction · 0.85

Tested by

no test coverage detected