From b198eca694b1d4bfdf0caea7867cb8869e6d093b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Sat, 9 Oct 2010 13:19:43 +0200 Subject: [PATCH] Bug 602832: 008filter.t doesn't catch [%~ ~%] correctly r/a=mkanat --- t/008filter.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/008filter.t b/t/008filter.t index 5a5b223c8a..6f95943abf 100644 --- a/t/008filter.t +++ b/t/008filter.t @@ -110,7 +110,7 @@ foreach my $path (@Support::Templates::include_paths) { # /g means we execute this loop for every match # /s means we ignore linefeeds in the regexp matches - while ($slurp =~ /\[%(.*?)%\]/gs) { + while ($slurp =~ /\[%(?:-|\+|~)?(.*?)(?:-|\+|~)?%\]/gs) { my $directive = $1; my @lineno = ($` =~ m/\n/gs); @@ -155,11 +155,11 @@ sub directive_ok { my ($file, $directive) = @_; # Comments - return 1 if $directive =~ /^[+-]?#/; + return 1 if $directive =~ /^#/; - # Remove any leading/trailing + or - and whitespace. - $directive =~ s/^[+-]?\s*//; - $directive =~ s/\s*[+-]?$//; + # Remove any leading/trailing whitespace. + $directive =~ s/^\s*//; + $directive =~ s/\s*$//; # Empty directives are ok; they are usually line break helpers return 1 if $directive eq ''; -- 2.47.2