mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
be26a374e9
commit
a4b0c3c26b
2 changed files with 47 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Nov 26 20:02:39 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* test/ruby/test_settracefunc.rb: add tests for a_call/a_return
|
||||
by Brandur <brandur@mutelight.org> [Feature #9120]
|
||||
|
||||
Tue Nov 26 19:29:52 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* common.mk: add useful config "set breakpoint pending on"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue