From f8a7fb227b59463b37180b1e525c5d19ec0e43cb Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 27 Apr 2007 07:55:40 +0000 Subject: * Make pagespec_match on failure return a value that is false, but in a scalar context, evaluates to a reason why the match failed. * Add testpagespec plugin, which might be useful to see why a pagespec isn't matching something. --- t/pagespec_match.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 't/pagespec_match.t') diff --git a/t/pagespec_match.t b/t/pagespec_match.t index eac2395ed..f0cadcdc7 100755 --- a/t/pagespec_match.t +++ b/t/pagespec_match.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 49; +use Test::More tests => 51; BEGIN { use_ok("IkiWiki"); } @@ -67,6 +67,10 @@ ok(! pagespec_match("foo", "no_such_function(foo)"), "foo"); ok(pagespec_match("foo", "foo and user(bar)", user => "bar"), "user"); ok(! pagespec_match("foo", "foo and user(bar)", user => "baz"), "user fail"); +my $ret=pagespec_match("foo", "(invalid"); +ok(! $ret, "syntax error"); +ok($ret eq "syntax error", "error message"); + # old style globlists ok(pagespec_match("foo", "foo bar"), "simple list"); ok(pagespec_match("bar", "foo bar"), "simple list 2"); -- cgit v1.2.3