Verifies: SYS-REQ-014 [boundary] — lone high surrogate → U+FFFD, no following bytes consumed.
(t *testing.T)
| 232 | // Verifies: SYS-REQ-014 [boundary] — lone high surrogate → U+FFFD, no |
| 233 | // following bytes consumed. |
| 234 | func TestUnescapeLoneHighSurrogate(t *testing.T) { |
| 235 | out, err := Unescape([]byte(`\uDB29`), nil) |
| 236 | if err != nil { |
| 237 | t.Fatalf("Unescape(`\\uDB29`) returned error %v; expected U+FFFD substitution", err) |
| 238 | } |
| 239 | if got := string(out); got != replacementChar { |
| 240 | t.Errorf("Unescape(`\\uDB29`) = %q; expected %q (U+FFFD)", got, replacementChar) |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | // Verifies: SYS-REQ-014 [boundary] — the bug: high surrogate followed by |
| 245 | // non-escape bytes was synthesizing U+DC271; must be U+FFFD + literal "A7FA". |
nothing calls this directly
no test coverage detected