X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f8a7fb227b59463b37180b1e525c5d19ec0e43cb..df512e55dfbbb912cdf4aee5db48622301bb29ac:/IkiWiki/Plugin/testpagespec.pm?ds=inline

diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm
index 56dc03cef..f9ec90d87 100644
--- a/IkiWiki/Plugin/testpagespec.pm
+++ b/IkiWiki/Plugin/testpagespec.pm
@@ -12,12 +12,22 @@ sub import { #{{{
 sub preprocess (@) { #{{{
 	my %params=@_;
 	
+	foreach my $param (qw{match pagespec}) {
+		if (! exists $params{$param}) {
+			return "[[testpagespec $param parameter is required]]";
+		}
+	}
+
 	add_depends($params{page}, $params{pagespec});
 	
 	my $ret=pagespec_match($params{match}, $params{pagespec}, 
 			location => $params{page});
-	return $ret if ! $ret;
-	return "the pagespec matches";
+	if ($ret) {
+		return "match: $ret";
+	}
+	else {
+		return "no match: $ret";
+	}
 } # }}}
 
 1