diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-05 09:39:18 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-05 09:39:18 +0000 |
| commit | 7f275c7c445d42d49e9c2df083c2be3e8e62eb72 (patch) | |
| tree | 932de41da66d182358a082fc9639cdf66a044a8d /test/ripper/test_parser_events.rb | |
| parent | a2e512ed8e5c2fe725f5b3a6313982948a86294d (diff) | |
merges r25402 from trunk into ruby_1_9_1. fixes the backport task #1921.
--
* parse.y (parser_here_document): dispatch delayed heredoc
contents. based on a patch from Andy Keep in [ruby-core:24855].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@26008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_parser_events.rb')
| -rw-r--r-- | test/ripper/test_parser_events.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index 80199ecce..2494434d8 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -202,6 +202,20 @@ class TestRipper_ParserEvents < Test::Unit::TestCase assert_equal true, thru_bodystmt end + def test_heredoc + bug1921 = '[ruby-core:24855]' + thru_heredoc_beg = false + tree = parse("<<EOS\nheredoc\nEOS\n", :on_heredoc_beg) {thru_heredoc_beg = true} + assert_equal true, thru_heredoc_beg + assert_match(/string_content\(\),heredoc\n/, tree, bug1921) + heredoc = nil + parse("<<EOS\nheredoc1\nheredoc2\nEOS\n", :on_string_add) {|n, s| heredoc = s} + assert_equal("heredoc1\nheredoc2\n", heredoc, bug1921) + heredoc = nil + parse("<<-EOS\nheredoc1\nheredoc2\n\tEOS\n", :on_string_add) {|n, s| heredoc = s} + assert_equal("heredoc1\nheredoc2\n", heredoc, bug1921) + end + =begin def test_brace_block assert_equal true, $thru__brace_block |
