Mixed encoding error can continue to parse

This commit is contained in:
Nobuyoshi Nakada 2019-05-24 16:10:59 +09:00
parent 45ad375acc
commit 2893550452
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
3 changed files with 22 additions and 15 deletions

View file

@ -562,6 +562,9 @@ class TestParse < Test::Unit::TestCase
assert_raise(SyntaxError) { eval(" ?a\x8a".force_encoding("utf-8")) }
assert_equal("\u{1234}", eval("?\u{1234}"))
assert_equal("\u{1234}", eval('?\u{1234}'))
assert_equal("\u{1234}", eval('?\u1234'))
e = assert_syntax_error('"#{?\u123}"', 'invalid Unicode escape')
assert_not_match(/end-of-input/, e.message)
end
def test_percent