aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-11 03:52:55 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-11 03:52:55 +0000
commitc439d5a8abcbdac5e00e32362413cbe29c2d8f0e (patch)
treeb6da39cd88d3ed5c95df677c03081c30fbd2c6b9
parent80508e4e7955b22293c8f74486f48d1655496f62 (diff)
downloadikiwiki-c439d5a8abcbdac5e00e32362413cbe29c2d8f0e.tar
ikiwiki-c439d5a8abcbdac5e00e32362413cbe29c2d8f0e.tar.gz
add
-rwxr-xr-xt/pagename.t14
-rwxr-xr-xt/pagetype.mdwn14
2 files changed, 28 insertions, 0 deletions
diff --git a/t/pagename.t b/t/pagename.t
new file mode 100755
index 000000000..96e6a87f1
--- /dev/null
+++ b/t/pagename.t
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More tests => 5;
+
+BEGIN { use_ok("IkiWiki"); }
+
+# Used internally.
+$IkiWiki::hooks{htmlize}{mdwn}=1;
+
+is(pagename("foo.mdwn"), "foo");
+is(pagename("foo/bar.mdwn"), "foo/bar");
+is(pagename("foo.png"), "foo.png");
+is(pagename("foo"), "foo");
diff --git a/t/pagetype.mdwn b/t/pagetype.mdwn
new file mode 100755
index 000000000..76cacd8f7
--- /dev/null
+++ b/t/pagetype.mdwn
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More tests => 5;
+
+BEGIN { use_ok("IkiWiki"); }
+
+# Used internally.
+$IkiWiki::hooks{htmlize}{mdwn}=1;
+
+is(pagetype("foo.mdwn"), "mdwn");
+is(pagetype("foo/bar.mdwn"), "mdwn");
+is(pagename("foo.png"), undef);
+is(pagename("foo"), undef);