diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-04-27 07:55:40 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-04-27 07:55:40 +0000 |
commit | f8a7fb227b59463b37180b1e525c5d19ec0e43cb (patch) | |
tree | e5355a6b8c338c48c6b3a81c877426c11692929a /t | |
parent | 98c287f19ea03d897046d2aae669638741a112fb (diff) | |
download | ikiwiki-f8a7fb227b59463b37180b1e525c5d19ec0e43cb.tar ikiwiki-f8a7fb227b59463b37180b1e525c5d19ec0e43cb.tar.gz |
* 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.
Diffstat (limited to 't')
-rwxr-xr-x | t/pagespec_match.t | 6 |
1 files changed, 5 insertions, 1 deletions
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"); |