mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread.c, vm_eval.c: add Thread.backtrace.
* test/ruby/test_thread.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d3027870ee
commit
63bd8a74e8
4 changed files with 44 additions and 0 deletions
|
@ -516,4 +516,14 @@ class TestThreadGroup < Test::Unit::TestCase
|
|||
c.class_eval { def initialize; end }
|
||||
assert_raise(ThreadError) { c.new.start }
|
||||
end
|
||||
|
||||
def test_backtrace
|
||||
Thread.new{
|
||||
assert_equal(Array, Thread.main.backtrace.class)
|
||||
}.join
|
||||
|
||||
t = Thread.new{}
|
||||
t.join
|
||||
assert_equal(nil, t.backtrace)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue