aboutsummaryrefslogtreecommitdiff
path: root/t/bestlink.t
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-01-06 04:22:46 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-01-06 04:22:46 +0000
commit7c7bbfc3a93e2389c5c92c7d93e46cce6ec3ac48 (patch)
treed606cb92e8394fadd851a2e47c43dd33f3db6756 /t/bestlink.t
parent7bc7eb106ec21784a2a03aed5eab172f7bf83a0f (diff)
downloadikiwiki-7c7bbfc3a93e2389c5c92c7d93e46cce6ec3ac48.tar
ikiwiki-7c7bbfc3a93e2389c5c92c7d93e46cce6ec3ac48.tar.gz
Add userdir testcases. This also fixes an undefined value.
Diffstat (limited to 't/bestlink.t')
-rwxr-xr-xt/bestlink.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/bestlink.t b/t/bestlink.t
index 9358bf376..033b80d74 100755
--- a/t/bestlink.t
+++ b/t/bestlink.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 9;
+use Test::More tests => 11;
BEGIN { use_ok("IkiWiki"); }
@@ -12,6 +12,7 @@ sub test ($$$) {
%IkiWiki::pagecase=();
%links=();
+ $IkiWiki::config{userdir}="foouserdir";
foreach my $page (@existing_pages) {
$IkiWiki::pagecase{lc $page}=$page;
$links{$page}=[];
@@ -28,3 +29,5 @@ is(test("bar", "FoO", ["bar", "fOo"]), "fOo", "simple link with different page a
is(test("bar", "Foo", ["bar", "fOo", "foo", "fOO", "Foo", "fOo"]), "Foo", "in case of ambiguity, like case wins");
is(test("bar", "foo", ["bar", "foo", "bar/foo"]), "bar/foo", "simple subpage link");
is(test("bar", "foo/subpage", ["bar", "foo", "bar/subpage", "foo/subpage"]), "foo/subpage", "cross subpage link");
+is(test("bar", "bob", ["bar", "foo", "foouserdir/bob"]), "foouserdir/bob", "user link");
+is(test("bar", "bob", ["bar", "foo", "bob", "foouserdir/bob"]), "bob", "non-user link");