summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-17 08:47:58 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-17 08:47:58 +0000
commita30d133a036f406350e2a6f3a77b4086ef25b209 (patch)
tree195192688dc9b1a1a9f7690c1221e9e98b3636e6 /test/ruby
parentfcdabb50b8323de516483327ff84f7954a91032c (diff)
The test for TracePoint with thread had never worked correctly
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_settracefunc.rb6
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)|