Skip to content

Commit

Permalink
html2: Add test for tokenizing replaced control characters
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlinden committed Nov 19, 2023
1 parent 6715201 commit 046c275
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions html2/tokenizer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,13 @@ int main() {
expect_token(tokens, EndOfFileToken{});
});

etest::test("numeric character reference, control with replacement", [] {
auto tokens = run_tokenizer("Š");
expect_text(tokens, "\xc5\xa0"); // U+0160: LATIN CAPITAL LETTER S WITH CARON
expect_error(tokens, ParseError::ControlCharacterReference);
expect_token(tokens, EndOfFileToken{});
});

etest::test("numeric character reference, no digits", [] {
auto tokens = run_tokenizer("&#b;");
expect_text(tokens, "&#b;");
Expand Down

0 comments on commit 046c275

Please sign in to comment.