aboutsummaryrefslogtreecommitdiff
path: root/t/bestlink.t
diff options
context:
space:
mode:
Diffstat (limited to 't/bestlink.t')
-rwxr-xr-xt/bestlink.t10
1 files changed, 5 insertions, 5 deletions
diff --git a/t/bestlink.t b/t/bestlink.t
index ece900152..9358bf376 100755
--- a/t/bestlink.t
+++ b/t/bestlink.t
@@ -3,23 +3,23 @@ use warnings;
use strict;
use Test::More tests => 9;
+BEGIN { use_ok("IkiWiki"); }
+
sub test ($$$) {
my $page=shift;
my $link=shift;
my @existing_pages=@{shift()};
%IkiWiki::pagecase=();
- %IkiWiki::links=();
+ %links=();
foreach my $page (@existing_pages) {
$IkiWiki::pagecase{lc $page}=$page;
- $IkiWiki::links{$page}=[];
+ $links{$page}=[];
}
- return IkiWiki::bestlink($page, $link);
+ return bestlink($page, $link);
}
-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");