* lib/test/unit/util/backtracefilter.rb: fixed a bug that occurred

when an exception had no backtrace.

	* test/testunit/util/test_backtracefilter.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ntalbott 2003-11-21 22:36:13 +00:00
parent cf971d47b9
commit 0125719694
3 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,10 @@
Sat Nov 22 07:30:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
* lib/test/unit/util/backtracefilter.rb: fixed a bug that occurred
when an exception had no backtrace.
* test/testunit/util/test_backtracefilter.rb: ditto.
Fri Nov 21 16:44:18 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkentry.rb: fix the encoding trouble of percent
@ -22,7 +29,7 @@ Fri Nov 21 01:40:00 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* eval.c: undef is_ruby_native() function when not HAVE_NATIVETHREAD
Thu Nov 21 00:43:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
Fri Nov 21 00:43:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
* lib/test/unit/assertions.rb: use #__send__ instead of #send.
@ -83,7 +90,7 @@ Wed Nov 19 11:04:47 2003 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/fileutils.rb (cannot_overwrite_file?, have_st_ino?): bccwin32
is same as mswin32.
Tue Nov 19 07:54:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
Wed Nov 19 07:54:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
* lib/test/unit.rb: do not run tests if $! is set.
@ -283,7 +290,7 @@ Wed Nov 12 06:11:39 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
ossl_pkcs7_set_crls): add functions for PKCS7#certificates=
PKCS7#certificates, PKCS7#crls= and PKCS7#crls.
Tue Nov 12 00:47:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
Wed Nov 12 00:47:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
* lib/test/unit/ui/testrunnermediator.rb: should require 'test/unit'.
@ -320,7 +327,7 @@ Mon Nov 10 00:07:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (primary): primary_value may be 0 when syntax error.
[ruby-talk:84893]
Sat Nov 9 02:05:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
Sun Nov 9 02:05:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
* lib/test/unit/assertions.rb: un-deprecated #assert_not_nil to
maintain symmetry with #assert_nil. Also added better output for

View File

@ -7,6 +7,7 @@ module Test
TESTUNIT_RB_FILE = /\.rb\Z/
def filter_backtrace(backtrace, prefix=nil)
return ["No backtrace"] unless(backtrace)
split_p = if(prefix)
prefix.split(TESTUNIT_FILE_SEPARATORS)
else

View File

@ -32,7 +32,10 @@ backtrace = [%q{tc_thing.rb:4:in 'a'},
%q{C:\some\old\path\test\unit\testcase.rb:44:in 'run'},
%q{C:\some\old\path\test\unit.rb:44:in 'run'}]
assert_equal(backtrace, filter_backtrace(backtrace, %q{C:\some\old\path\test\unit}), "Should filter out all TestUnit-specific lines")
end
def test_nil_backtrace
assert_equal(["No backtrace"], filter_backtrace(nil))
end
end
end