diff options
Diffstat (limited to 'test/ripper/test_scanner_events.rb')
-rw-r--r-- | test/ripper/test_scanner_events.rb | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index 5d6ac615ca..792f19ef1a 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -179,6 +179,11 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase scan('backtick', %q[p `make all`]) end + def test_colon2_call + assert_equal ["::"], + scan('op', %q[ a::b ]) + end + def test_comma assert_equal [','] * 6, scan('comma', %q[ m(0,1,2,3,4,5,6) ]) @@ -986,13 +991,21 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase assert_equal("\e", err[2]) end - def test_invalid_hex_escape + def test_invalid_escape + err = nil + assert_equal ["\\C-\u{3042}"], scan('tstring_content', %["\\C-\u{3042}"]) {|*e| err = e} + assert_equal [:on_parse_error, "Invalid escape character syntax", "\\C-\u{3042}"], err + end + + def test_invalid_hex_escape_string err = nil - assert_equal ['U'], scan('tstring_content', '"\\xU"') {|*e| err = e} + assert_equal ['\\x', 'U'], scan('tstring_content', '"\\xU"') {|*e| err = e} assert_equal [:on_parse_error, "invalid hex escape", "\\x"], err + end + def test_invalid_hex_escape_regexp err = nil - assert_equal ['U'], scan('tstring_content', '/\\xU/') {|*e| err = e} + assert_equal ['\\x', 'U'], scan('tstring_content', '/\\xU/') {|*e| err = e} assert_equal [:on_parse_error, "invalid hex escape", "\\x"], err end |