mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_settracefunc.rb: added test for c-return.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9606ff514f
commit
6697b0a728
2 changed files with 15 additions and 9 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Mar 16 23:39:13 2005 Shugo Maeda <shugo@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_settracefunc.rb: added test for c-return.
|
||||
|
||||
Wed Mar 16 22:57:43 2005 Shugo Maeda <shugo@ruby-lang.org>
|
||||
|
||||
* eval.c (rb_call0): call_cfunc() should be protected.
|
||||
|
|
|
@ -11,16 +11,18 @@ class TestSetTraceFunc < Test::Unit::TestCase
|
|||
a = 1
|
||||
foo
|
||||
a
|
||||
b = 1 + 2
|
||||
set_trace_func nil
|
||||
|
||||
assert_equal(["line", 11], events.shift) # line "a = 1"
|
||||
assert_equal(["line", 12], events.shift) # line "foo"
|
||||
assert_equal(["call", 4], events.shift) # call foo
|
||||
event, lineno = events.shift # return
|
||||
assert_equal("return", event)
|
||||
assert_equal(4, lineno) # [history] it could not be expected in 1.8
|
||||
assert_equal(["line", 13], events.shift) # line "a"
|
||||
assert_equal(["line", 14], events.shift) # line "set_trace_func nil"
|
||||
assert_equal(["c-call", 14], events.shift) # c-call set_trace_func
|
||||
assert_equal(["line", 11], events.shift) # line "a = 1"
|
||||
assert_equal(["line", 12], events.shift) # line "foo"
|
||||
assert_equal(["call", 4], events.shift) # call foo
|
||||
assert_equal(["return", 4], events.shift) # return foo
|
||||
assert_equal(["line", 13], events.shift) # line "a"
|
||||
assert_equal(["line", 14], events.shift) # line "b = 1 + 2"
|
||||
assert_equal(["c-call", 14], events.shift) # c-call Fixnum#+
|
||||
assert_equal(["c-return", 14], events.shift) # c-return Fixnum#+
|
||||
assert_equal(["line", 15], events.shift) # line "set_trace_func nil"
|
||||
assert_equal(["c-call", 15], events.shift) # c-call set_trace_func
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue