diff options
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/testpagespec.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm index 4966f4e10..a0bb2ff31 100644 --- a/IkiWiki/Plugin/testpagespec.pm +++ b/IkiWiki/Plugin/testpagespec.pm @@ -12,6 +12,12 @@ sub import { #{{{ sub preprocess (@) { #{{{ my %params=@_; + foreach my $param (qw{match pagespec}) { + if (! exists $params{$param}) { + return "[[testpagespec missing $param parameter]]"; + } + } + add_depends($params{page}, $params{pagespec}); my $ret=pagespec_match($params{match}, $params{pagespec}, @@ -19,6 +25,9 @@ sub preprocess (@) { #{{{ if ($ret) { return "match: $ret"; } + elsif (! defined $ret) { + return "match failed: $@"; + } else { return "no match: $ret"; } |