summaryrefslogtreecommitdiff
path: root/test/fiber
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2022-12-20 17:59:46 +0100
committerBenoit Daloze <eregontp@gmail.com>2022-12-20 19:32:23 +0100
commit45175962a6fd74ab2e9ba92f1280f3987af25494 (patch)
tree7a4fcccfd76b12ffdc853a93822ba74b56b4e6e6 /test/fiber
parent88040063d0ec8aa64e0de2a3afae7286ec53bfdb (diff)
Never use the storage of another Fiber, that violates the whole design
* See https://bugs.ruby-lang.org/issues/19078#note-30
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6972
Diffstat (limited to 'test/fiber')
-rw-r--r--test/fiber/test_storage.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/fiber/test_storage.rb b/test/fiber/test_storage.rb
index 0a6942617c..d5f1f10a68 100644
--- a/test/fiber/test_storage.rb
+++ b/test/fiber/test_storage.rb
@@ -83,13 +83,12 @@ class TestFiberStorage < Test::Unit::TestCase
Fiber[:count] = 0
enumerator = Enumerator.new do |y|
- # Since the fiber is implementation detail, the storage are shared with the parent:
Fiber[:count] += 1
y << Fiber[:count]
end
assert_equal 1, enumerator.next
- assert_equal 1, Fiber[:count]
+ assert_equal 0, Fiber[:count]
end.resume
end