diff options
| author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-16 14:39:02 +0000 |
|---|---|---|
| committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-16 14:39:02 +0000 |
| commit | b30c83be514f86dde8ca0e455af7da62dd61c3fa (patch) | |
| tree | 9c886b884ce3e626139848600472ae331b4813f5 /test/ruby | |
| parent | b8cc43a5b024c52b673e7c43fd4998fefd87064f (diff) | |
| download | ruby-b30c83be514f86dde8ca0e455af7da62dd61c3fa.tar.gz ruby-b30c83be514f86dde8ca0e455af7da62dd61c3fa.tar.xz ruby-b30c83be514f86dde8ca0e455af7da62dd61c3fa.zip | |
* eval.c (rb_call0): call_cfunc() should be protected.
* test/ruby/test_settracefunc.rb: added test for c-return.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_settracefunc.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index f1eb47b75..e8ac6e2ab 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -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_not_equal(4, lineno)# it should be 4 but cannot 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 |
