diff options
Diffstat (limited to 'test/ruby/test_settracefunc.rb')
-rw-r--r-- | test/ruby/test_settracefunc.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 076c35d730..7157d8c482 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -812,14 +812,16 @@ class TestSetTraceFunc < Test::Unit::TestCase def test_tracepoint_inspect events = [] + th = nil trace = TracePoint.new{|tp| - next if !target_thread? + next if !target_thread? && th != Thread.current events << [tp.event, tp.inspect] } assert_equal("#<TracePoint:disabled>", trace.inspect) trace.enable{ assert_equal("#<TracePoint:enabled>", trace.inspect) - Thread.new{}.join + th = Thread.new{} + th.join } assert_equal("#<TracePoint:disabled>", trace.inspect) events.each{|(ev, str)| |