Subject: | Failure on vanilla 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 blithe.local 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep 8
17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh
powerpc
The version of Test::Harness shipped w/5.4.5 is 1.1602 and needs the #
of tests at the beginning, so I changed the test files to fix that. The
overriding of $SIG{__WARN__} also had a typo ($@ needs to be @_). For
Tiny.pm, in 5.4.5 "exists" only works with hash values (not array
values) so I removed the exists at the end of parsefile(). This won't
change functionality b/c the values being tested won't autovivify. I
also added a test for the value of $file before s///g in Tiny.pm,
because otherwise an "Undefined value..." warning is thrown making the
second test in 00-file-handling.t fail. The attached file is a patch.
Subject: | XML-Tiny.5.4.5.patch |
diff -u -r lib/XML/Tiny.pm.orig lib/XML/Tiny.pm
--- lib/XML/Tiny.pm.orig 2007-01-27 04:10:34.000000000 -0800
+++ lib/XML/Tiny.pm 2007-01-27 03:58:06.000000000 -0800
@@ -64,6 +64,7 @@
$file = <FH>;
close(FH);
} else { $file = <$arg>; }
+ die("No elements\n") if (!defined $file or $file =~ /^\s*$/);
# strip leading/trailing whitespace and comments (which don't nest - phew!)
$file =~ s/^\s+|<!--.*?-->|\s+$//g;
diff -u -r t/00-file-handling.t.orig t/00-file-handling.t
--- t/00-file-handling.t.orig 2007-01-25 10:05:54.000000000 -0800
+++ t/00-file-handling.t 2007-01-27 04:14:26.000000000 -0800
@@ -2,10 +2,12 @@
use strict;
require "t/test_functions";
+my $tests = $] >= 5.005003 ? 5 : 4;
+print "1..$tests\n";
$^W = 1;
-$SIG{__WARN__} = sub { die("Caught a warning, making it fatal:\n\n$@\n"); };
+$SIG{__WARN__} = sub { die("Caught a warning, making it fatal:\n\n@_\n"); };
eval { parsefile("t/non-existent-file"); };
ok($@ eq "XML::Tiny::parsefile: Can't open t/non-existent-file\n",
diff -u -r t/01-real-world-xml.t.orig t/01-real-world-xml.t
--- t/01-real-world-xml.t.orig 2007-01-25 10:05:59.000000000 -0800
+++ t/01-real-world-xml.t 2007-01-27 03:31:39.000000000 -0800
@@ -2,6 +2,8 @@
use strict;
require "t/test_functions";
+my $tests = 2;
+print "1..$tests\n";
$^W = 1;
diff -u -r t/02-oddballs.t.orig t/02-oddballs.t
--- t/02-oddballs.t.orig 2007-01-25 10:06:04.000000000 -0800
+++ t/02-oddballs.t 2007-01-27 03:31:52.000000000 -0800
@@ -2,6 +2,8 @@
use strict;
require "t/test_functions";
+my $tests = 1;
+print "1..$tests\n";
$^W = 1;
diff -u -r t/test_functions.orig t/test_functions
--- t/test_functions.orig 2007-01-25 09:21:57.000000000 -0800
+++ t/test_functions 2007-01-27 03:29:47.000000000 -0800
@@ -66,6 +66,4 @@
}
}
-sub END { print "1..$counter\n"; }
-
1;