link and backlink pagespec tests
parent
4e20fa0553
commit
fae3da7ce3
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
use Test::More tests => 21;
|
use Test::More tests => 25;
|
||||||
|
|
||||||
BEGIN { use_ok("IkiWiki"); }
|
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.png", "* and !*.*"));
|
||||||
ok(IkiWiki::pagespec_match("foo", "(bar or ((meep and foo) or (baz or foo) or beep))"));
|
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
|
# old style globlists
|
||||||
ok(IkiWiki::pagespec_match("foo", "foo bar"), "simple list");
|
ok(IkiWiki::pagespec_match("foo", "foo bar"), "simple list");
|
||||||
ok(IkiWiki::pagespec_match("bar", "foo bar"), "simple list 2");
|
ok(IkiWiki::pagespec_match("bar", "foo bar"), "simple list 2");
|
||||||
|
|
Loading…
Reference in New Issue