Skip to content

Commit

Permalink
test Text.check: add garbage at the end in character reference cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jul 11, 2024
1 parent 18214a6 commit 0832562
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_text_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def test_entity_reference_missing_colon
assert_check_failed("&amp", "&")
end

def test_character_reference_decimal_garbage_at_the_end
# U+0030 DIGIT ZERO
assert_check_failed("&#48x;", "&")
end

def test_character_reference_decimal_invalid_value
# U+0008 BACKSPACE
assert_check_failed("", "")
Expand All @@ -82,6 +87,11 @@ def test_character_reference_format_hex_00x
assert_check_failed("&#00x41;", "&#00x41;")
end

def test_character_reference_hex_garbage_at_the_end
# U+0030 DIGIT ZERO
assert_check_failed("&#x48x;", "&")
end

def test_character_reference_hex_surrogate_block
# U+0D800 SURROGATE PAIR
assert_check_failed("�", "�")
Expand Down

0 comments on commit 0832562

Please sign in to comment.