summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/pagename.t5
-rwxr-xr-xt/pagetype.t10
2 files changed, 8 insertions, 7 deletions
diff --git a/t/pagename.t b/t/pagename.t
index c7f1ce180..43f574e98 100755
--- a/t/pagename.t
+++ b/t/pagename.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 5;
+use Test::More tests => 6;
BEGIN { use_ok("IkiWiki"); }
@@ -10,5 +10,8 @@ $IkiWiki::hooks{htmlize}{mdwn}{call}=sub {};
is(pagename("foo.mdwn"), "foo");
is(pagename("foo/bar.mdwn"), "foo/bar");
+
+# bare files get the full filename as page name
is(pagename("foo.png"), "foo.png");
+is(pagename("foo/bar.png"), "foo/bar.png");
is(pagename("foo"), "foo");
diff --git a/t/pagetype.t b/t/pagetype.t
index 2df59387a..bb06a1568 100755
--- a/t/pagetype.t
+++ b/t/pagetype.t
@@ -6,12 +6,10 @@ use Test::More tests => 6;
BEGIN { use_ok("IkiWiki"); }
# Used internally.
-$IkiWiki::hooks{htmlize}{mdwn}=1;
+$IkiWiki::hooks{htmlize}{mdwn}={};
is(pagetype("foo.mdwn"), "mdwn");
is(pagetype("foo/bar.mdwn"), "mdwn");
-
-# bare files get the full filename as page name
-is(pagename("foo.png"), "foo.png");
-is(pagename("foo/bar.png"), "foo/bar.png");
-is(pagename("foo"), "foo");
+is(pagetype("foo.png"), undef);
+is(pagetype("foo/bar.png"), undef);
+is(pagetype("foo"), undef);