diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2010-10-09 13:17:30 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2010-10-09 13:17:30 +0200 |
commit | b6efd9328a1e888aec61e41f70ee1f53a6c85324 (patch) | |
tree | df0a94899af70ad40fc4880f0b95bb47234dc63a | |
parent | f1973062b3ccda18738e188738da55af12b90f96 (diff) | |
download | bugs-b6efd9328a1e888aec61e41f70ee1f53a6c85324.tar bugs-b6efd9328a1e888aec61e41f70ee1f53a6c85324.tar.gz bugs-b6efd9328a1e888aec61e41f70ee1f53a6c85324.tar.bz2 bugs-b6efd9328a1e888aec61e41f70ee1f53a6c85324.tar.xz bugs-b6efd9328a1e888aec61e41f70ee1f53a6c85324.zip |
Bug 602832: 008filter.t doesn't catch [%~ ~%] correctly
r/a=mkanat
-rw-r--r-- | t/008filter.t | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/t/008filter.t b/t/008filter.t index 0c38380df..c0ee3b131 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 ''; |