diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-26 11:03:57 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-26 11:03:57 +0000 |
commit | a4b0c3c26bcf7eab7c58b00eab2a75ed7d3c31b6 (patch) | |
tree | 9552176afc359fa742cfb39defc31a7967eb4ff6 /test/ruby/test_settracefunc.rb | |
parent | be26a374e994fe070f04928308700a37f46d75d0 (diff) | |
download | ruby-a4b0c3c26bcf7eab7c58b00eab2a75ed7d3c31b6.tar.gz |
* test/ruby/test_settracefunc.rb: add tests for a_call/a_return
by Brandur <brandur@mutelight.org> [Feature #9120]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_settracefunc.rb')
-rw-r--r-- | test/ruby/test_settracefunc.rb | 42 |
1 files changed, 42 insertions, 0 deletions
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 |