diff options
Diffstat (limited to 'bootstraptest/test_thread.rb')
| -rw-r--r-- | bootstraptest/test_thread.rb | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb index d7d19e97c9..7ff5bb4a38 100644 --- a/bootstraptest/test_thread.rb +++ b/bootstraptest/test_thread.rb @@ -242,9 +242,22 @@ assert_equal 'true', %{ end } +assert_equal 'true', %{ + Thread.new{}.join + begin + Process.waitpid2 fork{ + Thread.new{ + sleep 0.1 + }.join + } + true + rescue NotImplementedError + true + end +} + assert_equal 'ok', %{ - open("zzz_t1.rb", "w") do |f| - f.puts <<-END + File.write("zzz_t1.rb", <<-END) begin Thread.new { fork { GC.start } }.join pid, status = Process.wait2 @@ -253,7 +266,6 @@ assert_equal 'ok', %{ $result = :ok end END - end require "./zzz_t1.rb" $result } @@ -408,8 +420,7 @@ assert_equal 'ok', %q{ } assert_equal 'ok', %{ - open("zzz_t2.rb", "w") do |f| - f.puts <<-'end;' # do + File.write("zzz_t2.rb", <<-'end;') # do begin m = Thread::Mutex.new parent = Thread.current @@ -431,7 +442,6 @@ assert_equal 'ok', %{ $result = :ok end end; - end require "./zzz_t2.rb" $result } @@ -483,7 +493,8 @@ assert_equal 'foo', %q{ [th1, th2].each {|t| t.join } GC.start f.call.source -} unless ENV['RUN_OPTS'] =~ /rjit/ # flaky +} + assert_normal_exit %q{ class C def inspect |
