diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-02-19 18:22:51 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-02-19 18:23:40 -0500 |
commit | 8c8b18935b84bcfbf06649c9683e236e39f75df3 (patch) | |
tree | b020a75d1f424cb5dac47ead20cf626c62df7865 /t/pagetype.t | |
parent | 621e8d876ba516ee1aa641554280c20cfbbf0fc7 (diff) |
fix pagetype test
File had wrong name, and made wrong assumption about what pagetype does for
bare files.
Diffstat (limited to 't/pagetype.t')
-rwxr-xr-x | t/pagetype.t | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/pagetype.t b/t/pagetype.t new file mode 100755 index 000000000..2df59387a --- /dev/null +++ b/t/pagetype.t @@ -0,0 +1,17 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More tests => 6; + +BEGIN { use_ok("IkiWiki"); } + +# Used internally. +$IkiWiki::hooks{htmlize}{mdwn}=1; + +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"); |