]> sipb.mit.edu Git - ikiwiki.git/blobdiff - t/pagespec_match.t
link and backlink pagespec tests
[ikiwiki.git] / t / pagespec_match.t
index 35d420f1052b88aca3e28fd399c92fe3f72719cf..2a370a217119062aa13671e6c06bb0b2f4c2c2d6 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
-use Test::More tests => 20;
+use Test::More tests => 25;
 
 BEGIN { use_ok("IkiWiki"); }
 
@@ -17,6 +17,13 @@ ok(! IkiWiki::pagespec_match("foo", "f?? and !foo"));
 ok(! IkiWiki::pagespec_match("foo", "* and !foo"));
 ok(! IkiWiki::pagespec_match("foo", "foo and !foo"));
 ok(! IkiWiki::pagespec_match("foo.png", "* and !*.*"));
+ok(IkiWiki::pagespec_match("foo", "(bar or ((meep and foo) or (baz or foo) or beep))"));
+
+$IkiWiki::links{foo}=[qw{bar baz}];
+ok(IkiWiki::pagespec_match("foo", "link(bar)"));
+ok(! IkiWiki::pagespec_match("foo", "link(quux)"));
+ok(IkiWiki::pagespec_match("bar", "backlink(foo)"));
+ok(! IkiWiki::pagespec_match("quux", "backlink(foo)"));
 
 # old style globlists
 ok(IkiWiki::pagespec_match("foo", "foo bar"), "simple list");