From 63bd8a74e81537ecf2aba0be0f8ef6eec9df2758 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 14 Jun 2009 05:59:23 +0000 Subject: * 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 --- test/ruby/test_thread.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ruby/test_thread.rb') diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index b460cadea9..d0c35d8273 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -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 -- cgit v1.2.3