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)
| 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). |
| 281 | func 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 |
nothing calls this directly
no test coverage detected