]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
add
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 11 Sep 2006 03:52:55 +0000 (03:52 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 11 Sep 2006 03:52:55 +0000 (03:52 +0000)
t/pagename.t [new file with mode: 0755]
t/pagetype.mdwn [new file with mode: 0755]

diff --git a/t/pagename.t b/t/pagename.t
new file mode 100755 (executable)
index 0000000..96e6a87
--- /dev/null
@@ -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 (executable)
index 0000000..76cacd8
--- /dev/null
@@ -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);