aboutsummaryrefslogtreecommitdiff
path: root/t/bestlink.t
diff options
context:
space:
mode:
Diffstat (limited to 't/bestlink.t')
-rwxr-xr-xt/bestlink.t9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/bestlink.t b/t/bestlink.t
index ed748b0f2..825c88ff2 100755
--- a/t/bestlink.t
+++ b/t/bestlink.t
@@ -1,16 +1,16 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 5;
+use Test::More tests => 8;
sub test ($$$) {
my $page=shift;
my $link=shift;
my @existing_pages=@{shift()};
- %IkiWiki::links=();
+ %IkiWiki::pagecase=();
foreach my $page (@existing_pages) {
- $IkiWiki::links{$page}=[];
+ $IkiWiki::pagecase{lc $page}=$page;
}
return IkiWiki::bestlink($page, $link);
@@ -20,5 +20,8 @@ BEGIN { use_ok("IkiWiki"); }
is(test("bar", "foo", ["bar"]), "", "broken link");
is(test("bar", "foo", ["bar", "foo"]), "foo", "simple link");
+is(test("bar", "FoO", ["bar", "foo"]), "foo", "simple link with different input case");
+is(test("bar", "foo", ["bar", "fOo"]), "fOo", "simple link with different page case");
+is(test("bar", "FoO", ["bar", "fOo"]), "fOo", "simple link with different page and input case");
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");