]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - t/pagename.t
add keepextension tests
[git.ikiwiki.info.git] / t / pagename.t
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use Test::More tests => 8;
6 BEGIN { use_ok("IkiWiki"); }
8 # Used internally.
9 $IkiWiki::hooks{htmlize}{mdwn}={};
10 $IkiWiki::hooks{htmlize}{txt}={keepextension => 1};
12 is(pagename("foo.mdwn"), "foo");
13 is(pagename("foo/bar.mdwn"), "foo/bar");
15 # bare files get the full filename as page name
16 is(pagename("foo.png"), "foo.png");
17 is(pagename("foo/bar.png"), "foo/bar.png");
18 is(pagename("foo"), "foo");
20 # keepextension preserves the extension in the page name
21 is(pagename("foo.txt"), "foo.txt");
22 is(pagename("foo/bar.txt"), "foo/bar.txt");