diff options
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_scanner_events.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index 9005e46f4e..7d5bb3c814 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -66,6 +66,11 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase [[2, 0], :on_tstring_content, "heredoc\n"], [[3, 0], :on_heredoc_end, "EOS"]], Ripper.lex("<<EOS\nheredoc\nEOS") + assert_equal [[[1, 0], :on_heredoc_beg, "<<EOS"], + [[1, 5], :on_nl, "\n"], + [[2, 0], :on_heredoc_end, "EOS"]], + Ripper.lex("<<EOS\nEOS"), + "bug#4543" assert_equal [[[1, 0], :on_regexp_beg, "/"], [[1, 1], :on_tstring_content, "foo\nbar"], [[2, 3], :on_regexp_end, "/"]], @@ -654,6 +659,9 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase assert_equal [], scan('heredoc_end', '') assert_equal ["EOS"], + scan('heredoc_end', "<<EOS\nEOS"), + "bug#4543" + assert_equal ["EOS"], scan('heredoc_end', "<<EOS\nheredoc\nEOS") assert_equal ["EOS\n"], scan('heredoc_end', "<<EOS\nheredoc\nEOS\n") |