X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/8fa8bd0adb034f05131648dcb7b14011672649e8..8e68780b960a7921d8e001c5a728ab5e4aa1cb62:/t/pagespec_match.t diff --git a/t/pagespec_match.t b/t/pagespec_match.t index 635381e2b..9d5573747 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 => 52; +use Test::More tests => 54; BEGIN { use_ok("IkiWiki"); } @@ -40,7 +40,9 @@ $links{"examples/softwaresite/bugs/fails_to_frobnicate"}=[qw{done}]; $links{"examples/softwaresite/bugs/done"}=[]; ok(pagespec_match("foo", "link(bar)"), "link"); +ok(pagespec_match("foo", "link(ba?)"), "glob link"); ok(! pagespec_match("foo", "link(quux)"), "failed link"); +ok(! pagespec_match("foo", "link(qu*)"), "failed glob link"); ok(pagespec_match("bugs/foo", "link(done)", location => "bugs/done"), "link match to bestlink"); ok(! pagespec_match("examples/softwaresite/bugs/done", "link(done)", location => "bugs/done"), "link match to bestlink"); @@ -49,6 +51,8 @@ ok(pagespec_match("examples/softwaresite/bugs/fails_to_frobnicate", ok(! pagespec_match("foo", "link(./bar)", location => "foo/bar"), "link relative fail"); ok(pagespec_match("bar", "backlink(foo)"), "backlink"); ok(! pagespec_match("quux", "backlink(foo)"), "failed backlink"); +ok(! pagespec_match("bar", ""), "empty pagespec should match nothing"); +ok(! pagespec_match("bar", " "), "blank pagespec should match nothing"); $IkiWiki::pagectime{foo}=1154532692; # Wed Aug 2 11:26 EDT 2006 $IkiWiki::pagectime{bar}=1154532695; # after @@ -65,12 +69,9 @@ ok(! pagespec_match("foo", "creation_day(3)"), "other day"); 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"); +ok($ret =~ /syntax error/, "error message"); # old style globlists ok(pagespec_match("foo", "foo bar"), "simple list");