* Add a unit test for globlist_match().
[ikiwiki] / t / globlist_match.t
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use Test::More tests => 11;
5
6 BEGIN { use_ok("IkiWiki"); }
7 ok(IkiWiki::globlist_match("foo", "*"));
8 ok(IkiWiki::globlist_match("foo", "f?? !foz"));
9 ok(! IkiWiki::globlist_match("foo", "f?? !foo"));
10 ok(! IkiWiki::globlist_match("foo", "* !foo"));
11 ok(! IkiWiki::globlist_match("foo", "foo !foo"));
12 ok(IkiWiki::globlist_match("page", "?ag?"));
13 ok(! IkiWiki::globlist_match("page", "?a?g?"));
14 ok(! IkiWiki::globlist_match("foo.png", "* !*.*"));
15 ok(IkiWiki::globlist_match("foo.png", "*.*"));
16 ok(! IkiWiki::globlist_match("foo", "*.*"));