[Templates-cvs] cvs commit: Template2/t fileline.t
cvs@template-toolkit.org
cvs@template-toolkit.org
cvs 06/05/29 14:09:26
Modified: t fileline.t
Log:
Removed the line number from warnings reported at (eval $line).
It appears that Perl gets the $line wrong on FreeBSD but it's
not important to the test. The correct line number is still
identified after that.
Revision Changes Path
1.6 +8 -3 Template2/t/fileline.t
Index: fileline.t
===================================================================
RCS file: /template-toolkit/Template2/t/fileline.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- fileline.t 2006/01/30 15:28:55 1.5
+++ fileline.t 2006/05/29 14:09:26 1.6
@@ -12,7 +12,7 @@
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# $Id: fileline.t,v 1.5 2006/01/30 15:28:55 abw Exp $
+# $Id: fileline.t,v 1.6 2006/05/29 14:09:26 abw Exp $
#
#========================================================================
@@ -37,7 +37,12 @@
warning => sub { return $warning },
file => sub {
$warning =~ /at (.*?) line/;
- return $1;
+ my $file = $1;
+ # Perl appears to report different (eval $line) line numbers
+ # on FreeBSD, but it's not important to the success or failure
+ # of the test, so we delete the line number
+ $file =~ s/eval\s+\d+/eval/;
+ return $file;
},
line => sub {
$warning =~ /line (\d*)/;
@@ -91,7 +96,7 @@
-- expect --
Hello
World
-file: (eval 10)
+file: (eval)
line: 10
warn: Argument "" isn't numeric in addition (+)