1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@16021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-04-14 15:47:51 +00:00
parent 71263844e2
commit fee4ed204f
4 changed files with 80 additions and 57 deletions

View file

@ -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