Subject: | t/20_policy_prohibittrailingwhitespace.t fails on Perl 5.8.0 |
Perl::Critic 1.04 fails in t/20_policy_prohibittrailingwhitespace.t on Perl 5.8.0 (yeah, I know
that's pretty old, but I'm stuck with it) with the following error:
Variable "%SPACE" is not imported at t/20_policy_prohibittrailingwhitespace.t line 45.
Global symbol "%SPACE" requires explicit package name at t/
20_policy_prohibittrailingwhitespace.t line 45.
Execution of t/20_policy_prohibittrailingwhitespace.t aborted due to compilation errors.
# Looks like your test died before it could output anything.
t/20_policy_prohibittrailingwhitespace....dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-2
Failed 2/2 tests, 0.00% okay
The fix is to put a backslash in front of a couple open braces. Here's a patch:
--- t/20_policy_prohibittrailingwhitespace.t~ 2007-03-19 22:38:51.000000000 -0400
+++ t/20_policy_prohibittrailingwhitespace.t 2007-03-20 01:58:50.956761000 -0400
@@ -43,8 +43,8 @@
#-----------------------------------------------------------------------------
$code = <<"END_PERL";
-sub${SPACE}do_frobnication${SPACE}{
-\tfor${SPACE}(${SPACE}is_frobnicating()${SPACE})${SPACE}{
+sub${SPACE}do_frobnication${SPACE}\{
+\tfor${SPACE}(${SPACE}is_frobnicating()${SPACE})${SPACE}\{
${SPACE}${SPACE}${SPACE}${SPACE}frobnicate();
\l}
}