diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-14 09:54:58 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-14 09:54:58 +0000 |
commit | f41b284fab83ad067eead551e7e9b3d67b2a1e8e (patch) | |
tree | cc95bc12236e1227dad1e3dd665271941f8d670d /test | |
parent | 87a120fbdc25544135e8d625e8dc11950b7245a3 (diff) | |
download | ruby-f41b284fab83ad067eead551e7e9b3d67b2a1e8e.tar.gz |
* compile.c (rb_iseq_compile_node): fix location of a `trace'
instruction (b_return event).
[ruby-core:55305] [ruby-trunk - Bug #8489]
(need a backport to 2.0.0?)
* test/ruby/test_settracefunc.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_settracefunc.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index ab1a37f8eb..4319c8fc75 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -953,4 +953,17 @@ class TestSetTraceFunc < Test::Unit::TestCase set_trace_func(nil) end end + + def test_tracepoint_b_return_with_next + n = 0 + TracePoint.new(:b_return){ + n += 1 + }.enable{ + 3.times{ + next + } # 3 times b_retun + } # 1 time b_return + + assert_equal 4, n + end end |