diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-01 17:08:01 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-01 17:08:01 +0000 |
commit | 03228aabec1f0e036d4333dc94c7a82e3e6447f2 (patch) | |
tree | 1a190fe460d827fefb99e3f6fa82027b56e74f1e /test/ripper | |
parent | 52601dd1cc04becc98777fc8994de18924c18539 (diff) |
merge revision(s) 53722: [Backport #12232]
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix
Ripper.lex error in dedenting squiggly heredoc. heredoc tree is
also an array of Elem in the outer tree. [Fix GH-1234]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_scanner_events.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index ab52392eb1..1b7b56ebfe 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -103,6 +103,12 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase [[5, 0], :on_imaginary, "5.6ri"], ], Ripper.lex("1r\n2i\n3ri\n4.2r\n5.6ri") + assert_equal [[[1, 0], :on_heredoc_beg, "<<~EOS"], + [[1, 6], :on_nl, "\n"], + [[2, 2], :on_tstring_content, "heredoc\n"], + [[3, 0], :on_heredoc_end, "EOS"] + ], + Ripper.lex("<<~EOS\n heredoc\nEOS") end def test_location |