summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-09-30 15:24:36 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-09-30 16:34:38 +1300
commit388281c5c92d4c04bfb08aeac7513770de9ea128 (patch)
treea6bb09ae1b7387222b6ba1a8bbf1db22bcab688f /test
parent48b94b791997881929c739c64f95ac30f3fd0bb9 (diff)
Fix order of operations during `rb_ec_finalize`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3605
Diffstat (limited to 'test')
-rw-r--r--test/fiber/test_scheduler.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/fiber/test_scheduler.rb b/test/fiber/test_scheduler.rb
index 0e70585a9c..23b59c06b0 100644
--- a/test/fiber/test_scheduler.rb
+++ b/test/fiber/test_scheduler.rb
@@ -35,4 +35,18 @@ class TestFiberScheduler < Test::Unit::TestCase
thread.join
end
+
+ def test_close_at_exit
+ assert_in_out_err %W[-I#{__dir__} -], <<-RUBY, ['Running Fiber'], [], success: true
+ require 'scheduler'
+
+ scheduler = Scheduler.new
+ Thread.current.scheduler = scheduler
+
+ Fiber.schedule do
+ sleep(0)
+ puts "Running Fiber"
+ end
+ RUBY
+ end
end