diff --git a/ChangeLog b/ChangeLog index fca0563a07..4a4edc9e0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 26 20:02:39 2013 Koichi Sasada + + * test/ruby/test_settracefunc.rb: add tests for a_call/a_return + by Brandur [Feature #9120] + Tue Nov 26 19:29:52 2013 Koichi Sasada * common.mk: add useful config "set breakpoint pending on" diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index e85f36f6f0..1de7b901b0 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1024,4 +1024,46 @@ class TestSetTraceFunc < Test::Unit::TestCase 1.times {break} END end + + def test_a_call + events = [] + TracePoint.new(:a_call){|tp| + events << tp.event + }.enable{ + 1.times{ + 3 + } + method_for_test_tracepoint_block{ + 4 + } + } + assert_equal([ + :b_call, + :c_call, + :b_call, + :call, + :b_call, + ], events) + end + + def test_a_return + events = [] + TracePoint.new(:a_return){|tp| + events << tp.event + }.enable{ + 1.times{ + 3 + } + method_for_test_tracepoint_block{ + 4 + } + } + assert_equal([ + :b_return, + :c_return, + :b_return, + :return, + :b_return + ], events) + end end