Verifies: SYS-REQ-061 [malformed] High surrogate without low surrogate shall return MalformedValueError.
(t *testing.T)
| 617 | // Verifies: SYS-REQ-061 [malformed] |
| 618 | // High surrogate without low surrogate shall return MalformedValueError. |
| 619 | func TestMissingSurrogateLow(t *testing.T) { |
| 620 | // \uD800 alone (high surrogate, no low) |
| 621 | _, err := ParseString([]byte(`\uD800`)) |
| 622 | if !errors.Is(err, MalformedValueError) { |
| 623 | t.Fatalf("ParseString(high surrogate only) error = %v, want %v", err, MalformedValueError) |
| 624 | } |
| 625 | |
| 626 | // High surrogate followed by non-escape text |
| 627 | _, err = ParseString([]byte(`\uD800abc`)) |
| 628 | if !errors.Is(err, MalformedValueError) { |
| 629 | t.Fatalf("ParseString(high surrogate + text) error = %v, want %v", err, MalformedValueError) |
| 630 | } |
| 631 | } |
| 632 | |
| 633 | // Verifies: SYS-REQ-062 [malformed] |
| 634 | // High surrogate followed by invalid low surrogate shall return MalformedValueError. |
nothing calls this directly
no test coverage detected
searching dependent graphs…