aboutsummaryrefslogtreecommitdiffstats
path: root/test/ripper
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-01 21:32:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-01 21:32:04 +0000
commit0a190272cdbe182eea4d27407c680370dd8afde8 (patch)
treebe4cb1bc1fa1883fdfa3e0558c672ac4088a40f7 /test/ripper
parent1549a6b78daaa4f3efa1d47eb6c9e52b080578b8 (diff)
downloadruby-0a190272cdbe182eea4d27407c680370dd8afde8.tar.gz
parse.y: preserve tSTRING_CONTENT results
* parse.y (ripper_flush_string_content): preserve the dispatched results at tSTRING_CONTENT. [ruby-dev:48714] [Bug #10437] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_sexp.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ripper/test_sexp.rb b/test/ripper/test_sexp.rb
index adf8c46ec7..2c5bcdacde 100644
--- a/test/ripper/test_sexp.rb
+++ b/test/ripper/test_sexp.rb
@@ -26,6 +26,9 @@ class TestRipper::Sexp < Test::Unit::TestCase
sexp = Ripper.sexp('/foo/')
assert_equal 'foo', search_sexp(:@tstring_content, search_sexp(:regexp_literal, sexp))[1]
+ sexp = Ripper.sexp("/foo\nbar/")
+ assert_equal "foo\nbar", search_sexp(:@tstring_content, search_sexp(:regexp_literal, sexp))[1]
+
sexp = Ripper.sexp('/(?<n>a(b|\g<n>))/')
assert_equal '(?<n>a(b|\g<n>))', search_sexp(:@tstring_content, search_sexp(:regexp_literal, sexp))[1]
end