2006-09-11 05:52:55 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
2009-02-20 00:31:57 +01:00
|
|
|
use Test::More tests => 8;
|
2006-09-11 05:52:55 +02:00
|
|
|
|
|
|
|
BEGIN { use_ok("IkiWiki"); }
|
|
|
|
|
|
|
|
# Used internally.
|
2009-02-20 00:31:57 +01:00
|
|
|
$IkiWiki::hooks{htmlize}{mdwn}={};
|
|
|
|
$IkiWiki::hooks{htmlize}{txt}={keepextension => 1};
|
2006-09-11 05:52:55 +02:00
|
|
|
|
|
|
|
is(pagename("foo.mdwn"), "foo");
|
|
|
|
is(pagename("foo/bar.mdwn"), "foo/bar");
|
2009-02-20 00:28:43 +01:00
|
|
|
|
|
|
|
# bare files get the full filename as page name
|
2006-09-11 05:52:55 +02:00
|
|
|
is(pagename("foo.png"), "foo.png");
|
2009-02-20 00:28:43 +01:00
|
|
|
is(pagename("foo/bar.png"), "foo/bar.png");
|
2006-09-11 05:52:55 +02:00
|
|
|
is(pagename("foo"), "foo");
|
2009-02-20 00:31:57 +01:00
|
|
|
|
|
|
|
# keepextension preserves the extension in the page name
|
|
|
|
is(pagename("foo.txt"), "foo.txt");
|
|
|
|
is(pagename("foo/bar.txt"), "foo/bar.txt");
|