mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added assertions for Unicode escaped CHAR scanner events
This commit is contained in:
parent
f296c260ef
commit
9d8855b682
1 changed files with 11 additions and 0 deletions
|
@ -941,9 +941,20 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase
|
|||
scan('CHAR', "@ivar")
|
||||
|
||||
assert_equal ["?\\M-H"], scan('CHAR', '?\\M-H')
|
||||
|
||||
assert_equal ["?\\u0041"],
|
||||
scan('CHAR', "?\\u0041")
|
||||
|
||||
assert_equal ["?\\u{41}"],
|
||||
scan('CHAR', "?\\u{41}")
|
||||
|
||||
err = nil
|
||||
assert_equal [], scan('CHAR', '?\\M ') {|*e| err = e}
|
||||
assert_equal([:on_parse_error, "Invalid escape character syntax", "?\\M "], err)
|
||||
|
||||
err = nil
|
||||
scan('CHAR', '?\u{41 42}') {|*e| err = e}
|
||||
assert_equal [:on_parse_error, "Multiple codepoints at single character literal", "42"], err
|
||||
end
|
||||
|
||||
def test_label
|
||||
|
|
Loading…
Reference in a new issue