summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-12 17:14:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-12 17:14:38 +0000
commit1b60a978a2cb67a2ea5423d5bed3a1d6edbb2eaf (patch)
tree66e8b2d32bf108d8dd377bb9a1ba4c40d5acd169 /test
parent7523a076c1ae2b3d7b55fcaa357c05ddb2c132a2 (diff)
merge revision(s) 57801: [Backport #13287]
parse.y: remove trace * parse.y (reg_named_capture_assign_iter): do not insert trace instructions before local variable assinments. putobject is expected at first. [ruby-core:79940] [Bug #13287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_regexp.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 112af60c96..2c4c9709f7 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -205,6 +205,15 @@ class TestRegexp < Test::Unit::TestCase
assert_not_include(local_variables, :nil, "[ruby-dev:32675]")
end
+ def test_assign_named_capture_trace
+ bug = '[ruby-core:79940] [Bug #13287]'
+ assert_normal_exit("#{<<-"begin;"}\n#{<<-"end;"}", bug)
+ begin;
+ / (?<foo>.*)/ =~ "bar" &&
+ true
+ end;
+ end
+
def test_match_regexp
r = /./
m = r.match("a")