fix pagetype test
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 19 Feb 2009 23:22:51 +0000 (18:22 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 19 Feb 2009 23:23:40 +0000 (18:23 -0500)
File had wrong name, and made wrong assumption about what pagetype does for
bare files.

t/pagetype.t [moved from t/pagetype.mdwn with 51% similarity]

similarity index 51%
rename from t/pagetype.mdwn
rename to t/pagetype.t
index 76cacd8f7070ac76b1f9b2f786271da0bb9c7e7a..2df59387a6d22752606f6aaf54c74a27f1439820 100755 (executable)
@@ -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}=1;
 
 is(pagetype("foo.mdwn"), "mdwn");
 is(pagetype("foo/bar.mdwn"), "mdwn");
-is(pagename("foo.png"), undef);
-is(pagename("foo"), undef);
+
+# 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");