aboutsummaryrefslogtreecommitdiff
path: root/t/beautify_urlpath.t
blob: 94b923d3bd2fc9ad1dbc81588249272c0f509ff3 (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 => 8;

BEGIN { use_ok("IkiWiki"); }

$IkiWiki::config{usedirs} = 1;
$IkiWiki::config{htmlext} = "HTML";
is(IkiWiki::beautify_urlpath("foo/bar"), "./foo/bar");
is(IkiWiki::beautify_urlpath("../badger"), "../badger");
is(IkiWiki::beautify_urlpath("./bleh"), "./bleh");
is(IkiWiki::beautify_urlpath("foo/index.HTML"), "./foo/");
is(IkiWiki::beautify_urlpath("index.HTML"), "./");
is(IkiWiki::beautify_urlpath("../index.HTML"), "../");
$IkiWiki::config{usedirs} = 0;
is(IkiWiki::beautify_urlpath("foo/index.HTML"), "./foo/index.HTML");