Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Class CPAN distribution.

Report information
The Basics
Id:
20605
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
slanning [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
0.11
Fixed in:
(no value)



Subject: t/fail2 fails
t/die_before_plan......# Test 3 got: "# Failed test 'setup (for test method 'test') died (died before plan set)'" (t/die_before_plan.t at line 42 fail #3) # Expected: "# Failed test (t/die_before_plan.t at line 32)" # t/die_before_plan.t line 42 is: ok($actual, $expected); # Test 4 got: "# in t/die_before_plan.t at line 32." (t/die_before_plan.t at line 42 fail #4) # Expected: "ok 2 - test just here to get setup method run" Use of uninitialized value in scalar chomp at t/die_before_plan.t line 40, <DATA> line 4. Use of uninitialized value in substitution (s///) at t/die_before_plan.t line 41, <DATA> line 4. # Test 5 got: "ok 2 - test just here to get setup method run" (t/die_before_plan.t at line 42 fail #5) # Expected: <UNDEF> t/die_before_plan......FAILED tests 3-5 Failed 3/4 tests, 25.00% okay t/documented...........skipped all skipped: Test::Pod::Coverage required t/expected_tests.......ok t/fail1................ok t/fail2................# Test 3 got: "# Failed test 'The object isa Object'" (t/fail2.t at line 47 fail #3) # Expected: "# Failed test (t/fail2.t at line 22)" # t/fail2.t line 47 is: ok($actual, $expected); # Test 4 got: "# in t/fail2.t at line 22." (t/fail2.t at line 47 fail #4) # Expected: "# The object isn't defined" # Test 5 got: "# The object isn't defined" (t/fail2.t at line 47 fail #5) # Expected: "not ok 2 - cannot create Objects" # Test 6 got: "not ok 2 - cannot create Objects" (t/fail2.t at line 47 fail #6) # Expected: "# Failed test (t/fail2.t at line 22)" # Test 7 got: "# Failed test 'cannot create Objects'" (t/fail2.t at line 47 fail #7) # Expected: "not ok 3 - cannot create Objects" # Test 8 got: "# in t/fail2.t at line 22." (t/fail2.t at line 47 fail #8) # Expected: "# Failed test (t/fail2.t at line 22)" Use of uninitialized value in scalar chomp at t/fail2.t line 45, <DATA> line 8. Use of uninitialized value in substitution (s///) at t/fail2.t line 46, <DATA> line 8. # Test 9 got: "not ok 3 - cannot create Objects" (t/fail2.t at line 47 fail #9) # Expected: <UNDEF> Use of uninitialized value in scalar chomp at t/fail2.t line 45, <DATA> line 8. Use of uninitialized value in substitution (s///) at t/fail2.t line 46, <DATA> line 8. # Test 10 got: "# Failed test 'cannot create Objects'" (t/fail2.t at line 47 fail #10) # Expected: <UNDEF> Use of uninitialized value in scalar chomp at t/fail2.t line 45, <DATA> line 8. Use of uninitialized value in substitution (s///) at t/fail2.t line 46, <DATA> line 8. # Test 11 got: "# in t/fail2.t at line 22." (t/fail2.t at line 47 fail #11) # Expected: <UNDEF> t/fail2................FAILED tests 3-12 Failed 10/9 tests, -11.11% okay t/fail3................ok
From: NWCLARK@cpan.org
On Fri Jul 21 09:10:44 2006, SLANNING wrote:
Show quoted text
> t/die_before_plan......# Test 3 got: "# Failed test 'setup (for test
Show quoted text
> t/fail2................FAILED tests 3-12
I guess that Test::Builder updated its ouput format at some point, and the golden results in the two tests are now wrong. The attached patch makes things pass, and is probably the correct fix. Nicholas Clark
--- t/die_before_plan.t~ 2005-02-19 19:32:33.000000000 +0000 +++ t/die_before_plan.t 2006-09-25 13:57:59.000000000 +0100 @@ -31,14 +31,17 @@ $ENV{HARNESS_ACTIVE}=0; Object::Test->runtests; -plan tests => 4; +plan tests => 5; seek $io, SEEK_SET, 0; my $SEP = $^O eq "MSWin32" ? '\\' : '/'; while (my $actual = <$io>) { chomp($actual); - my $expected=<DATA>; chomp($expected); - $expected =~ s!/!$SEP!gs; + my $expected=<DATA>; + if (defined $expected) { + chomp($expected); + $expected =~ s!/!$SEP!gs; + } ok($actual, $expected); }; @@ -47,5 +50,6 @@ __DATA__ 1..1 not ok 1 - setup (for test method 'test') died (died before plan set) -# Failed test (t/die_before_plan.t at line 32) +# Failed test 'setup (for test method 'test') died (died before plan set)' +# in t/die_before_plan.t at line 32. ok 2 - test just here to get setup method run --- t/fail2.t~ 2005-02-19 19:32:33.000000000 +0000 +++ t/fail2.t 2006-09-25 14:01:55.000000000 +0100 @@ -26,7 +26,7 @@ package main; -plan tests => 9; +plan tests => 12; my $io = IO::File->new_tmpfile or die "couldn't create tmp file ($!)\n"; my $Test = Test::Builder->new; @@ -42,8 +42,11 @@ my $SEP = $^O eq "MSWin32" ? '\\' : '/'; while (my $actual = <$io>) { chomp($actual); - my $expected=<DATA>; chomp($expected); - $expected =~ s!/!$SEP!gs; + my $expected=<DATA>; + if (defined $expected) { + chomp($expected); + $expected =~ s!/!$SEP!gs; + } ok($actual, $expected); }; @@ -54,9 +57,12 @@ __DATA__ 1..3 not ok 1 - The object isa Object -# Failed test (t/fail2.t at line 22) +# Failed test 'The object isa Object' +# in t/fail2.t at line 22. # The object isn't defined not ok 2 - cannot create Objects -# Failed test (t/fail2.t at line 22) +# Failed test 'cannot create Objects' +# in t/fail2.t at line 22. not ok 3 - cannot create Objects -# Failed test (t/fail2.t at line 22) +# Failed test 'cannot create Objects' +# in t/fail2.t at line 22.
Finally fixed in 0.12


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.