4 use Test::More tests => 25;
6 BEGIN { use_ok("IkiWiki"); }
8 ok(IkiWiki::pagespec_match("foo", "*"));
9 ok(IkiWiki::pagespec_match("page", "?ag?"));
10 ok(! IkiWiki::pagespec_match("page", "?a?g?"));
11 ok(IkiWiki::pagespec_match("foo.png", "*.*"));
12 ok(! IkiWiki::pagespec_match("foo", "*.*"));
13 ok(IkiWiki::pagespec_match("foo", "foo or bar"), "simple list");
14 ok(IkiWiki::pagespec_match("bar", "foo or bar"), "simple list 2");
15 ok(IkiWiki::pagespec_match("foo", "f?? and !foz"));
16 ok(! IkiWiki::pagespec_match("foo", "f?? and !foo"));
17 ok(! IkiWiki::pagespec_match("foo", "* and !foo"));
18 ok(! IkiWiki::pagespec_match("foo", "foo and !foo"));
19 ok(! IkiWiki::pagespec_match("foo.png", "* and !*.*"));
20 ok(IkiWiki::pagespec_match("foo", "(bar or ((meep and foo) or (baz or foo) or beep))"));
22 $IkiWiki::links{foo}=[qw{bar baz}];
23 ok(IkiWiki::pagespec_match("foo", "link(bar)"));
24 ok(! IkiWiki::pagespec_match("foo", "link(quux)"));
25 ok(IkiWiki::pagespec_match("bar", "backlink(foo)"));
26 ok(! IkiWiki::pagespec_match("quux", "backlink(foo)"));
29 ok(IkiWiki::pagespec_match("foo", "foo bar"), "simple list");
30 ok(IkiWiki::pagespec_match("bar", "foo bar"), "simple list 2");
31 ok(IkiWiki::pagespec_match("foo", "f?? !foz"));
32 ok(! IkiWiki::pagespec_match("foo", "f?? !foo"));
33 ok(! IkiWiki::pagespec_match("foo", "* !foo"));
34 ok(! IkiWiki::pagespec_match("foo", "foo !foo"));
35 ok(! IkiWiki::pagespec_match("foo.png", "* !*.*"));