aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-05-02 07:03:52 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-05-02 07:03:52 +0000
commitf9ce7a571ddbe124bb93bcfd3388e2cd4d77ec06 (patch)
tree787f1488cbf663bfb914a8a6c37de38bdea68c30 /t
parent3b0fce93e40e5457b63ceda9692901539eb4fc82 (diff)
downloadikiwiki-f9ce7a571ddbe124bb93bcfd3388e2cd4d77ec06.tar
ikiwiki-f9ce7a571ddbe124bb93bcfd3388e2cd4d77ec06.tar.gz
* Add a unit test for globlist_match().
Diffstat (limited to 't')
-rwxr-xr-xt/globlist_match.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/globlist_match.t b/t/globlist_match.t
new file mode 100755
index 000000000..3d196e09c
--- /dev/null
+++ b/t/globlist_match.t
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More tests => 11;
+
+BEGIN { use_ok("IkiWiki"); }
+ok(IkiWiki::globlist_match("foo", "*"));
+ok(IkiWiki::globlist_match("foo", "f?? !foz"));
+ok(! IkiWiki::globlist_match("foo", "f?? !foo"));
+ok(! IkiWiki::globlist_match("foo", "* !foo"));
+ok(! IkiWiki::globlist_match("foo", "foo !foo"));
+ok(IkiWiki::globlist_match("page", "?ag?"));
+ok(! IkiWiki::globlist_match("page", "?a?g?"));
+ok(! IkiWiki::globlist_match("foo.png", "* !*.*"));
+ok(IkiWiki::globlist_match("foo.png", "*.*"));
+ok(! IkiWiki::globlist_match("foo", "*.*"));