beautify_urlpath: add a regression test
[ikiwiki.git] / t / beautify_urlpath.t
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use Test::More tests => 7;
5
6 BEGIN { use_ok("IkiWiki"); }
7
8 $IkiWiki::config{usedirs} = 1;
9 $IkiWiki::config{htmlext} = "HTML";
10 is(IkiWiki::beautify_urlpath("foo/bar"), "./foo/bar");
11 is(IkiWiki::beautify_urlpath("../badger"), "../badger");
12 is(IkiWiki::beautify_urlpath("./bleh"), "./bleh");
13 is(IkiWiki::beautify_urlpath("foo/index.HTML"), "./foo/");
14 is(IkiWiki::beautify_urlpath("index.HTML"), "./");
15 $IkiWiki::config{usedirs} = 0;
16 is(IkiWiki::beautify_urlpath("foo/index.HTML"), "./foo/index.HTML");