aboutsummaryrefslogtreecommitdiff
path: root/t/pagename.t
blob: 43f574e9878ba49e4e27396bf64484d9fb7df14c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 6;

BEGIN { use_ok("IkiWiki"); }

# Used internally.
$IkiWiki::hooks{htmlize}{mdwn}{call}=sub {};

is(pagename("foo.mdwn"), "foo");
is(pagename("foo/bar.mdwn"), "foo/bar");

# 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");