summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-21 12:50:30 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-21 12:50:30 -0500
commit9bee6db8c604efd705d6d808fca3194eb4873cf4 (patch)
tree5f4d6c35c0cd65fa18526f7512f4dfb271768abc /t
parentb2842b88385acb68569f00ed45b49f0cf5383983 (diff)
parent9e5f504e1a9c428580c17e13fc1f76bc38727e3c (diff)
Merge commit 'smcv/comments'
Diffstat (limited to 't')
-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");