From e1038377a9c8ec8002d07cfdbca6a1c0cca1fc8c Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 21 Mar 2019 05:59:14 +0000 Subject: Fix a wrong lineno in backtrace for cfunc lineno is an int, and INT2FIX(0) was assigned. [Bug #15719] [ruby-core:91911] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_backtrace.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_backtrace.rb b/test/ruby/test_backtrace.rb index 0730b5d1c5..00c96b3b9f 100644 --- a/test/ruby/test_backtrace.rb +++ b/test/ruby/test_backtrace.rb @@ -329,4 +329,18 @@ class TestBacktrace < Test::Unit::TestCase bar end; end + + def test_caller_to_enum + err = ["-:3:in `foo': unhandled exception", "\tfrom -:in `each'"] + assert_in_out_err([], <<-"end;", [], err, "[ruby-core:91911]") + def foo + return to_enum(__method__) unless block_given? + raise + yield 1 + end + + enum = foo + enum.next + end; + end end -- cgit v1.2.3