diff options
Diffstat (limited to 'bootstraptest/test_thread.rb')
| -rw-r--r-- | bootstraptest/test_thread.rb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb index 5361828403..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 } @@ -484,6 +494,7 @@ assert_equal 'foo', %q{ GC.start f.call.source } + assert_normal_exit %q{ class C def inspect |
