From 711f429d0215b364916f7f171981ea85059bcbcf Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 14 Apr 2008 15:47:51 +0000 Subject: * re.c (rb_reg_search): make search reentrant. [ruby-dev:34223] * test/ruby/test_parse.rb (TestParse::test_global_variable): should preserve $& variable. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_parse.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby/test_parse.rb') diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 7aaa17253..125af1fa3 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -670,8 +670,11 @@ x = __ENCODING__ def test_global_variable assert_equal(nil, eval('$-x')) + assert_equal(nil, eval('alias $preserve_last_match $&')) assert_equal(nil, eval('alias $& $test_parse_foobarbazqux')) $test_parse_foobarbazqux = nil + assert_equal(nil, $&) + assert_equal(nil, eval('alias $& $preserve_last_match')) assert_raise(SyntaxError) { eval('$#') } end -- cgit