Subject: | Test-Simple-0.64 test failure on perl 5.004_05 |
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");