diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_settracefunc.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 6021038fe9..29b69b7ce3 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -2127,4 +2127,21 @@ class TestSetTraceFunc < Test::Unit::TestCase tp.enable {obj.example} assert ok, "return event should be emitted" end + + def test_disable_local_tracepoint_in_trace + assert_normal_exit <<-EOS + def foo + trace = TracePoint.new(:b_return){|tp| + tp.disable + } + trace.enable(target: method(:bar)) + end + def bar + 100.times{|i| + foo; foo + } + end + bar + EOS + end end |