Skip to content

Commit

Permalink
Test unicode char parsing error (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjavaxx authored Feb 21, 2024
1 parent bd5e675 commit 344df13
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,13 @@ def test_raises_error_if_low_surrogate_is_not_formatted_correctly

assert_equal "Unexpected character '$', expecting 'U' at line 1, column 17 (offset: 16)", error.message
end

def test_raises_error_if_unicode_sequence_contains_invalid_characters
parser = DotStrings::Parser.new
error = assert_raises DotStrings::ParsingError do
parser << '"key" = "\UD83Z";'
end

assert_equal "Unexpected character 'Z', expecting a hex digit at line 1, column 15 (offset: 14)", error.message
end
end

0 comments on commit 344df13

Please sign in to comment.