diff --git a/ChangeLog b/ChangeLog index 14364d6495..ce13d39c7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Nov 22 07:30:00 2003 Nathaniel Talbott + + * 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 * ext/tk/lib/tkentry.rb: fix the encoding trouble of percent @@ -22,7 +29,7 @@ Fri Nov 21 01:40:00 2003 Hidetoshi NAGAI * eval.c: undef is_ruby_native() function when not HAVE_NATIVETHREAD -Thu Nov 21 00:43:00 2003 Nathaniel Talbott +Fri Nov 21 00:43:00 2003 Nathaniel Talbott * lib/test/unit/assertions.rb: use #__send__ instead of #send. @@ -83,7 +90,7 @@ Wed Nov 19 11:04:47 2003 NAKAMURA Usaku * lib/fileutils.rb (cannot_overwrite_file?, have_st_ino?): bccwin32 is same as mswin32. -Tue Nov 19 07:54:00 2003 Nathaniel Talbott +Wed Nov 19 07:54:00 2003 Nathaniel Talbott * lib/test/unit.rb: do not run tests if $! is set. @@ -283,7 +290,7 @@ Wed Nov 12 06:11:39 2003 GOTOU Yuuzou 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 +Wed Nov 12 00:47:00 2003 Nathaniel Talbott * lib/test/unit/ui/testrunnermediator.rb: should require 'test/unit'. @@ -320,7 +327,7 @@ Mon Nov 10 00:07:10 2003 Nobuyoshi Nakada * parse.y (primary): primary_value may be 0 when syntax error. [ruby-talk:84893] -Sat Nov 9 02:05:00 2003 Nathaniel Talbott +Sun Nov 9 02:05:00 2003 Nathaniel Talbott * lib/test/unit/assertions.rb: un-deprecated #assert_not_nil to maintain symmetry with #assert_nil. Also added better output for diff --git a/lib/test/unit/util/backtracefilter.rb b/lib/test/unit/util/backtracefilter.rb index 3a423aa6a1..7ebec2dfef 100644 --- a/lib/test/unit/util/backtracefilter.rb +++ b/lib/test/unit/util/backtracefilter.rb @@ -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 diff --git a/test/testunit/util/test_backtracefilter.rb b/test/testunit/util/test_backtracefilter.rb index eeabb91d22..d4e40ea6ab 100644 --- a/test/testunit/util/test_backtracefilter.rb +++ b/test/testunit/util/test_backtracefilter.rb @@ -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