diff options
| author | Kouhei Yanagita <yanagi@shakenbu.org> | 2023-11-22 18:12:23 +0900 |
|---|---|---|
| committer | Aaron Patterson <aaron.patterson@gmail.com> | 2023-12-12 09:36:37 -0800 |
| commit | 06e2fbb8260022de8532d2e940fc69e8ea413679 (patch) | |
| tree | d65696ce0fa324f2d00b77cebd532accea61fe4c /test | |
| parent | 1f22245ed5004ef097e192aec157b34409214a2a (diff) | |
[Bug #19114] Fix for multiple calls of TracePoint#enable
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_settracefunc.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 8fcc909d83..b7711e191d 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -2459,6 +2459,18 @@ CODE assert_equal [:tp1, 1, 2, :tp2, 3], events end + def test_multiple_enable + ary = [] + trace = TracePoint.new(:call) do |tp| + ary << tp.method_id + end + trace.enable + trace.enable + foo + trace.disable + assert_equal(1, ary.count(:foo), '[Bug #19114]') + end + def test_multiple_tracepoints_same_bmethod events = [] tp1 = TracePoint.new(:return) do |tp| |
