beautify_urlpath: add a regression test

master
Simon McVittie 2008-12-21 15:24:53 +00:00
parent 5b1cf21a35
commit c42f174e65
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/usr/bin/perl
use warnings;
use strict;
use Test::More tests => 7;
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"), "./");
$IkiWiki::config{usedirs} = 0;
is(IkiWiki::beautify_urlpath("foo/index.HTML"), "./foo/index.HTML");