From 64bc558cc5fe5f19ff47ce0715e3ddd557206eac Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 23 Dec 2007 02:22:27 +0000 Subject: [PATCH] add a test for [ruby-dev:32675] reported by Keita Yamaguchi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_regexp.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index d4b306ced7..520af49640 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -101,7 +101,13 @@ class TestRegexp < Test::Unit::TestCase assert_equal("a", eval('/(?.)/ =~ "a"; foo')) assert_equal("a", eval('foo = 1; /(?.)/ =~ "a"; foo')) assert_equal("a", eval('1.times {|foo| /(?.)/ =~ "a"; break foo }')) - assert_raise(SyntaxError) { eval('/(?.)/ =~ "a"') } + assert_nothing_raised { eval('/(?.)/ =~ "a"') } + assert_nil(eval('/(?.)/ =~ "a"; defined? Foo')) + end + + def test_assign_named_capture_to_reserved_word + /(?.)/ =~ "a" + assert(!local_variables.include?(:nil), "[ruby-dev:32675]") end def test_match_regexp