Verifies: SYS-REQ-062 [malformed] A high surrogate followed by an out-of-range second escape is a lone high surrogate → U+FFFD + the second escape reprocessed, matching encoding/json (DEFECT-260727-SNGT). SYS-REQ-062's error-return is superseded for this case.
(t *testing.T)
| 644 | // surrogate → U+FFFD + the second escape reprocessed, matching encoding/json |
| 645 | // (DEFECT-260727-SNGT). SYS-REQ-062's error-return is superseded for this case. |
| 646 | func TestInvalidSurrogateLow(t *testing.T) { |
| 647 | // \uD800\u0041 - valid unicode escape but not in low surrogate range → U+FFFD + 'A'. |
| 648 | got, err := ParseString([]byte(`\uD800\u0041`)) |
| 649 | if err != nil { |
| 650 | t.Fatalf("ParseString(invalid low surrogate) error = %v, want nil (U+FFFD + 'A')", err) |
| 651 | } |
| 652 | if got != "\uFFFDA" { |
| 653 | t.Fatalf("ParseString(invalid low surrogate) = %q, want %q", got, "\uFFFDA") |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | // Verifies: SYS-REQ-063 [malformed] |
| 658 | // Backslash at end of string shall return MalformedValueError. |
nothing calls this directly
no test coverage detected