summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-02 04:52:35 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-02 04:52:35 +0000
commitfae3da7ce3910d8aeb16ec875a5c2d4f095313ff (patch)
treed643419e043e6e9736abdd2f7e0a155e1c3f6e2b
parent4e20fa05531ee591c582d6735ca0b5f69ad09c0d (diff)
link and backlink pagespec tests
-rwxr-xr-xt/pagespec_match.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/pagespec_match.t b/t/pagespec_match.t
index 4f5ccc92c..2a370a217 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 => 21;
+use Test::More tests => 25;
BEGIN { use_ok("IkiWiki"); }
@@ -19,6 +19,12 @@ 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");
ok(IkiWiki::pagespec_match("bar", "foo bar"), "simple list 2");