From 5a34caab4f045b0808eb439fc51f5331328e054c Mon Sep 17 00:00:00 2001 From: zzak Date: Sat, 23 Feb 2013 08:08:24 +0000 Subject: test_backtrace.rb: test Thread#backtrace_locations with range git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_backtrace.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/ruby/test_backtrace.rb b/test/ruby/test_backtrace.rb index 2325c9306b..6ab9032855 100644 --- a/test/ruby/test_backtrace.rb +++ b/test/ruby/test_backtrace.rb @@ -141,4 +141,21 @@ class TestBacktrace < Test::Unit::TestCase q << true end end + + def test_thread_backtrace_locations_with_range + begin + q = Queue.new + th = Thread.new{ + th_rec q + } + sleep 0.5 + bt = th.backtrace(0,2) + locs = th.backtrace_locations(0..1).map { |loc| + loc.to_s + } + assert_equal(bt, locs) + ensure + q << true + end + end end -- cgit v1.2.3