aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-02-19 18:31:57 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-02-19 18:31:57 -0500
commit9ecb0036a32c6930d9400040161c3b9e41ef9b1f (patch)
tree25a9abdc78f90abb0eadb61225f1c9fc95edc560 /t
parentc1907ded879f75ef07c5bbab26b84042bafc1b17 (diff)
downloadikiwiki-9ecb0036a32c6930d9400040161c3b9e41ef9b1f.tar
ikiwiki-9ecb0036a32c6930d9400040161c3b9e41ef9b1f.tar.gz
add keepextension tests
Diffstat (limited to 't')
-rwxr-xr-xt/pagename.t9
1 files changed, 7 insertions, 2 deletions
diff --git a/t/pagename.t b/t/pagename.t
index 43f574e98..488e341fa 100755
--- a/t/pagename.t
+++ b/t/pagename.t
@@ -1,12 +1,13 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 6;
+use Test::More tests => 8;
BEGIN { use_ok("IkiWiki"); }
# Used internally.
-$IkiWiki::hooks{htmlize}{mdwn}{call}=sub {};
+$IkiWiki::hooks{htmlize}{mdwn}={};
+$IkiWiki::hooks{htmlize}{txt}={keepextension => 1};
is(pagename("foo.mdwn"), "foo");
is(pagename("foo/bar.mdwn"), "foo/bar");
@@ -15,3 +16,7 @@ is(pagename("foo/bar.mdwn"), "foo/bar");
is(pagename("foo.png"), "foo.png");
is(pagename("foo/bar.png"), "foo/bar.png");
is(pagename("foo"), "foo");
+
+# keepextension preserves the extension in the page name
+is(pagename("foo.txt"), "foo.txt");
+is(pagename("foo/bar.txt"), "foo/bar.txt");