diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-30 04:17:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-30 04:17:59 +0000 |
commit | 29707c1d73f35c15d118ea5ca2330e85ac475dd6 (patch) | |
tree | f5f5da12d8302369aec601b13c5f8bfa7d2f8d5b /test/ruby/test_fiber.rb | |
parent | 3df94d7b5d7129d50443b77f869835b958423fd5 (diff) | |
download | ruby-29707c1d73f35c15d118ea5ca2330e85ac475dd6.tar.gz |
cont.c: fiber local svar
* cont.c (cont_restore_thread): svar should be separate per fibers.
[ruby-core:51331] [Bug #7678]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_fiber.rb')
-rw-r--r-- | test/ruby/test_fiber.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index dcf1fca50a..38050386c4 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -317,5 +317,29 @@ class TestFiber < Test::Unit::TestCase size_large = invoke_rec script, vm_stack_size, 1024 * 1024 * 10 assert_operator(size_default, :<=, size_large) end + + def test_separate_lastmatch + bug7678 = '[ruby-core:51331]' + /a/ =~ "a" + m1 = $~ + m2 = nil + Fiber.new do + /b/ =~ "b" + m2 = $~ + end.resume + assert_equal("b", m2[0]) + assert_equal(m1, $~, bug7678) + end + + def test_separate_lastline + bug7678 = '[ruby-core:51331]' + $_ = s1 = "outer" + s2 = nil + Fiber.new do + s2 = "inner" + end.resume + assert_equal("inner", s2) + assert_equal(s1, $_, bug7678) + end end |