mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
a153ce31a1
commit
5a34caab4f
1 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue