summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-12-21 15:24:53 +0000
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-12-21 15:24:53 +0000
commitc42f174e655526bfaace70b31f9cbc79e2e1be9a (patch)
tree7c79e99a43901718a76667fa46779653e4689e18
parent5b1cf21a350ee6e3278b5279fbda9cd26ff8550d (diff)
beautify_urlpath: add a regression test
-rwxr-xr-xt/beautify_urlpath.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/beautify_urlpath.t b/t/beautify_urlpath.t
new file mode 100755
index 000000000..b9d3493a2
--- /dev/null
+++ b/t/beautify_urlpath.t
@@ -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");