summaryrefslogtreecommitdiff
path: root/test/ripper/test_sexp.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-28 10:33:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-28 10:33:58 +0000
commit448d1d147d3a0b636323d0c8d80f53a399d445af (patch)
tree163aa2ff30f32213db2391bd2928576e6af7f18b /test/ripper/test_sexp.rb
parentef44c0ad2fc9c91e90b69a1cfa88f923ac169256 (diff)
parse.y: last content of heredoc
* parse.y (parser_here_document): store dispatched result of on_tstring_content at the last fragment of a here document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_sexp.rb')
-rw-r--r--test/ripper/test_sexp.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ripper/test_sexp.rb b/test/ripper/test_sexp.rb
index 2c5bcda..8fc17fd 100644
--- a/test/ripper/test_sexp.rb
+++ b/test/ripper/test_sexp.rb
@@ -33,6 +33,11 @@ class TestRipper::Sexp < Test::Unit::TestCase
assert_equal '(?<n>a(b|\g<n>))', search_sexp(:@tstring_content, search_sexp(:regexp_literal, sexp))[1]
end
+ def test_heredoc_content
+ sexp = Ripper.sexp("<<E\nfoo\nE")
+ assert_equal "foo\n", search_sexp(:@tstring_content, sexp)[1]
+ end
+
def search_sexp(sym, sexp)
return sexp if !sexp or sexp[0] == sym
sexp.find do |e|