diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-23 08:08:24 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-23 08:08:24 +0000 |
commit | 5a34caab4f045b0808eb439fc51f5331328e054c (patch) | |
tree | 5f50f3881c4a4c0c7821598251c7dc720f5b825f /test/ruby/test_backtrace.rb | |
parent | a153ce31a13e090b780e8d95e52f3ddae3a412de (diff) | |
download | ruby-5a34caab4f045b0808eb439fc51f5331328e054c.tar.gz |
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
Diffstat (limited to 'test/ruby/test_backtrace.rb')
-rw-r--r-- | test/ruby/test_backtrace.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 |