ruby-changes:27379
From: zzak <ko1@a...>
Date: Sat, 23 Feb 2013 17:08:34 +0900 (JST)
Subject: [ruby-changes:27379] zzak:r39431 (trunk): test_backtrace.rb: test Thread#backtrace_locations with range
zzak 2013-02-23 17:08:24 +0900 (Sat, 23 Feb 2013) New Revision: 39431 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39431 Log: test_backtrace.rb: test Thread#backtrace_locations with range Modified files: trunk/test/ruby/test_backtrace.rb Index: test/ruby/test_backtrace.rb =================================================================== --- test/ruby/test_backtrace.rb (revision 39430) +++ test/ruby/test_backtrace.rb (revision 39431) @@ -141,4 +141,21 @@ class TestBacktrace < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/ruby/test_backtrace.rb#L141 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/