diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-12-20 17:59:46 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-12-20 19:32:23 +0100 |
commit | 45175962a6fd74ab2e9ba92f1280f3987af25494 (patch) | |
tree | 7a4fcccfd76b12ffdc853a93822ba74b56b4e6e6 /test/fiber/test_storage.rb | |
parent | 88040063d0ec8aa64e0de2a3afae7286ec53bfdb (diff) | |
download | ruby-45175962a6fd74ab2e9ba92f1280f3987af25494.tar.gz |
Never use the storage of another Fiber, that violates the whole design
* See https://bugs.ruby-lang.org/issues/19078#note-30
Diffstat (limited to 'test/fiber/test_storage.rb')
-rw-r--r-- | test/fiber/test_storage.rb | 3 |
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 |