Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 20513
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: david.romano+cpan [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Test-Simple-0.64 test failure on perl 5.004_05
Download (untitled) / with headers
text/plain 1.1k
perl -v: This is perl, version 5.004_05 built for ppc-darwin Copyright 1987-1998, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5.0 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. uname -a: Darwin paperweight.unobe.com 8.7.0 Darwin Kernel Version 8.7.0: Fri May 26 15:20:53 PDT 2006; root:xnu-792.6.76.obj~1/RELEASE_PPC Power Macintosh powerpc problem: During the `make test` of Test-Simple-0.64, many errors were found and consequently the test suite did not pass. The test files that were affected: t/skip.t t/tbt_01basic.t t/tbt_02fhrestore.t t/tbt_03die.t t/tbt_04line_num.t t/tbt_05fail_diag.t t/tbt_06errormess.t t/tbt_07args.t the failures were due to: a) the usage of qr// in a couple of the tests as well as in Test/Builder/Tester.pm used for testing. b) wrong expected return values when testing Test::Builder::Tester, specifically test_err(). solution: attached patch.
Subject: Test-Simple.patch
diff -ur Test-Simple-0.64/lib/Test/Builder/Tester.pm Test-Simple-0.64-patched/lib/Test/Builder/Tester.pm --- Test-Simple-0.64/lib/Test/Builder/Tester.pm 2006-07-16 02:47:23.000000000 -0700 +++ Test-Simple-0.64-patched/lib/Test/Builder/Tester.pm 2006-07-17 04:21:49.000000000 -0700 @@ -507,7 +507,7 @@ my($self, $check) = @_; if( $check =~ /\A(.*)# (Failed .*test) \((.*?) at line (\d+)\)\z/ ) { - $check = qr/\Q$1\E#\s+\Q$2\E.*?\n?.*?\Q$3\E at line \Q$4\E.*\n?/; + $check = "/\Q$1\E#\\s+\Q$2\E.*?\\n?.*?\Q$3\E at line \Q$4\E.*\\n?/"; } return $check; @@ -527,7 +527,7 @@ my @checks = @{$self->[2]}; my $got = $self->[1]; foreach my $check (@checks) { - $check = qr/^\Q$check\E/ unless ref $check; + $check = "\Q$check\E" unless ($check =~ s,^/(.*)/$,$1, or ref $check); return 0 unless $got =~ s/^$check//; } diff -ur Test-Simple-0.64/t/skip.t Test-Simple-0.64-patched/t/skip.t --- Test-Simple-0.64/t/skip.t 2006-07-16 02:06:03.000000000 -0700 +++ Test-Simple-0.64-patched/t/skip.t 2006-07-17 04:24:45.000000000 -0700 @@ -94,5 +94,5 @@ pass "This does not run"; } - like $warning, qr/^skip\(\) was passed a non-numeric number of tests/; + like $warning, "/^skip\Q()\E was passed a non-numeric number of tests/"; } diff -ur Test-Simple-0.64/t/tbt_01basic.t Test-Simple-0.64-patched/t/tbt_01basic.t --- Test-Simple-0.64/t/tbt_01basic.t 2006-07-16 02:39:26.000000000 -0700 +++ Test-Simple-0.64-patched/t/tbt_01basic.t 2006-07-17 04:27:07.000000000 -0700 @@ -22,7 +22,8 @@ test_test("multiple tests"); test_out("not ok 1 - should fail"); -test_err("# Failed test ($0 at line 28)"); +test_err("# Failed test 'should fail'"); +test_err("# in $0 at line 29."); test_err("# got: 'foo'"); test_err("# expected: 'bar'"); is("foo","bar","should fail"); @@ -46,7 +47,7 @@ test_out("not ok 1 - name # TODO Something"); -test_err("# Failed (TODO) test ($0 at line 52)"); +test_err("# Failed (TODO) test ($0 at line 53)"); TODO: { local $TODO = "Something"; fail("name");
Download (untitled) / with headers
text/plain 373b
On Mon Jul 17 07:57:11 2006, UNOBE wrote: Show quoted text
> solution: > attached patch.
Sorry, I had messed up on the the first patch (forgot one change to Test-Builder-Tester). These next two patches separate the Test-Builder-Tester.pm patch from the tests for Test-Simple.pm. I'm not sure how the changes will affect Test-Builder-Tester's test suite (if there is a separate one for it).
--- lib/Test/Builder/Tester.pm.orig 2006-07-17 06:16:20.000000000 -0700 +++ lib/Test/Builder/Tester.pm 2006-07-17 06:15:35.000000000 -0700 @@ -506,8 +506,8 @@ { my($self, $check) = @_; - if( $check =~ /\A(.*)# (Failed .*test) \((.*?) at line (\d+)\)\z/ ) { - $check = qr/\Q$1\E#\s+\Q$2\E.*?\n?.*?\Q$3\E at line \Q$4\E.*\n?/; + if( $check =~ /\A(.*)# (Failed .*test) \((.*?) at line (\d+)\)\Z/ ) { + $check = "/\Q$1\E#\\s+\Q$2\E.*?\\n?.*?\Q$3\E at line \Q$4\E.*\\n?/"; } return $check; @@ -527,7 +527,7 @@ my @checks = @{$self->[2]}; my $got = $self->[1]; foreach my $check (@checks) { - $check = qr/^\Q$check\E/ unless ref $check; + $check = "\Q$check\E" unless ($check =~ s,^/(.*)/$,$1, or ref $check); return 0 unless $got =~ s/^$check//; }
Download Test-Simple.patch
text/x-diff 998b
--- t/skip.t.orig 2006-07-17 06:18:45.000000000 -0700 +++ t/skip.t 2006-07-17 05:31:27.000000000 -0700 @@ -94,5 +94,5 @@ pass "This does not run"; } - like $warning, qr/^skip\(\) was passed a non-numeric number of tests/; + like $warning, "/^skip\Q()\E was passed a non-numeric number of tests/"; } --- t/tbt_01basic.t.orig 2006-07-17 06:19:45.000000000 -0700 +++ t/tbt_01basic.t 2006-07-17 05:31:27.000000000 -0700 @@ -22,7 +22,8 @@ test_test("multiple tests"); test_out("not ok 1 - should fail"); -test_err("# Failed test ($0 at line 28)"); +test_err("# Failed test 'should fail'"); +test_err("# in $0 at line 29."); test_err("# got: 'foo'"); test_err("# expected: 'bar'"); is("foo","bar","should fail"); @@ -46,7 +47,7 @@ test_out("not ok 1 - name # TODO Something"); -test_err("# Failed (TODO) test ($0 at line 52)"); +test_err("# Failed (TODO) test ($0 at line 53)"); TODO: { local $TODO = "Something"; fail("name");
Download (untitled) / with headers
text/plain 921b
On Mon Jul 17 09:30:20 2006, UNOBE wrote: Show quoted text
> On Mon Jul 17 07:57:11 2006, UNOBE wrote:
> > solution:
> > attached patch.
> Sorry, I had messed up on the the first patch (forgot one change to > Test-Builder-Tester). These next two patches separate the > Test-Builder-Tester.pm patch from the tests for Test-Simple.pm. I'm not > sure how the changes will affect Test-Builder-Tester's test suite (if > there is a separate one for it).
Thank you for testing with 5.4.5. I don't have one handy. I fixed skip.t but the Test::Builder::Tester patch did not apply cleanly. You might want to try again against the repository version. http://svn.schwern.org/CPAN/Test-Simple/trunk It also appears to change the behavior of TBT as evidenced by the need to change the results one of its tests. (No, there are no other TBT tests than the ones which ship with Test-Simple). I'm not really sure yet how to fix TBT to not use qr//.
Subject: Re: [rt.cpan.org #20513] Test-Simple-0.64 test failure on perl 5.004_05
Date: Fri, 10 Nov 2006 12:25:41 -0800
To: Michael_G_Schwern via RT <bug-Test-Simple [...] rt.cpan.org>
From: David Romano <unobe [...] cpan.org>
Download (untitled) / with headers
text/plain 932b
Michael_G_Schwern via RT wrote on Sun, Nov 05, 2006 at 09:57:18AM PST: Show quoted text
> Thank you for testing with 5.4.5. I don't have one handy.
You're welcome; thanks for the software :-) Show quoted text
> I fixed skip.t but the Test::Builder::Tester patch did not apply > cleanly. You might want to try again against the repository version. > http://svn.schwern.org/CPAN/Test-Simple/trunk > > It also appears to change the behavior of TBT as evidenced by the need > to change the results one of its tests. > > I'm not really sure yet how to fix TBT to not use qr//.
I've attached a patch against revision 3874 that fixes TBT to not use qr//, without having to change any crucial test results. I also changed t/pod-coverage.t so 5.004 doesn't fail when parsing it (using the same method you used in t/fail-like.t). I also tested my changes w/5.8.8 and w/5.8.6. - David -- "Where is human nature so weak as in the bookstore?" -- Henry Ward Beecher
Download TS.patch
text/x-diff 1.3k

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #20513] Test-Simple-0.64 test failure on perl 5.004_05
Date: Fri, 10 Nov 2006 14:47:40 -0600
To: bug-Test-Simple [...] rt.cpan.org
From: Michael G Schwern <schwern [...] gmail.com>
Download (untitled) / with headers
text/plain 492b
unobe@cpan.org via RT wrote: Show quoted text
> I've attached a patch against revision 3874 that fixes TBT to not use > qr//, without having to change any crucial test results.
Thanks, this applied cleanly. I left \z as \z. Why did you change it to \Z? Show quoted text
> I also changed t/pod-coverage.t so 5.004 doesn't fail when parsing it > (using the same method you used in t/fail-like.t). I also tested my > changes w/5.8.8 and w/5.8.6.
Turns out Pod::Coverage takes strings. Try the latest from the repo please.
Subject: Re: [rt.cpan.org #20513] Test-Simple-0.64 test failure on perl 5.004_05
Date: Fri, 10 Nov 2006 14:21:24 -0800
To: Michael G Schwern via RT <bug-Test-Simple [...] rt.cpan.org>
From: David Romano <unobe [...] cpan.org>
Download (untitled) / with headers
text/plain 1.2k
Michael G Schwern via RT wrote on Fri, Nov 10, 2006 at 12:48:45PM PST: Show quoted text
> Thanks, this applied cleanly. I left \z as \z. Why did you change it to \Z? > ... > Try the latest from the repo please.
The latest from the repo works cleanly except for a few TBT tests: Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/tbt_01basic.t 9 4 6-9 t/tbt_05faildiag.t 5 2 1-2 t/tbt_06errormess.t 8 3 4 7-8 t/tbt_07args.t 18 5 4 7-8 15-16 9 tests and 13 subtests skipped. Failed 4/67 test scripts. 14/476 subtests failed. Files=67, Tests=476, 30 wallclock secs ( 5.50 cusr + 1.70 csys = 7.20 CPU) Failed 4/67 test programs. 14/476 subtests failed. make: *** [test_dynamic] Error 35 5.4.5 doesn't have \z, so by replacing \z with \Z, the tests pass. Looking at the perlre man page for 5.4.5, \Z(?!\n) is suggested to match the very end of a string. Replacing \z with \Z(?!\n) makes all the tests pass as well. - David -- "Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order." -- Larry Wall
0.66 fixed this.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

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