2008-12-21 16:24:53 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
2008-12-21 18:59:11 +01:00
|
|
|
use Test::More tests => 8;
|
2008-12-21 16:24:53 +01:00
|
|
|
|
|
|
|
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"), "./");
|
2008-12-21 18:59:11 +01:00
|
|
|
is(IkiWiki::beautify_urlpath("../index.HTML"), "../");
|
2008-12-21 16:24:53 +01:00
|
|
|
$IkiWiki::config{usedirs} = 0;
|
|
|
|
is(IkiWiki::beautify_urlpath("foo/index.HTML"), "./foo/index.HTML");
|