summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-13 02:08:42 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-13 02:08:42 +0000
commitfcf3894e807958a40cd50aa350dbec21fb7410e2 (patch)
tree73c65dc5893a78e70dc5f83a406e003e5fe3b464
parent4b36dee35a55b08d6d6f3bb3840220a4956f2540 (diff)
update
-rwxr-xr-xt/bestlink.t5
-rwxr-xr-xt/linkify.t2
2 files changed, 6 insertions, 1 deletions
diff --git a/t/bestlink.t b/t/bestlink.t
index 825c88ff2..ece900152 100755
--- a/t/bestlink.t
+++ b/t/bestlink.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 8;
+use Test::More tests => 9;
sub test ($$$) {
my $page=shift;
@@ -9,8 +9,10 @@ sub test ($$$) {
my @existing_pages=@{shift()};
%IkiWiki::pagecase=();
+ %IkiWiki::links=();
foreach my $page (@existing_pages) {
$IkiWiki::pagecase{lc $page}=$page;
+ $IkiWiki::links{$page}=[];
}
return IkiWiki::bestlink($page, $link);
@@ -23,5 +25,6 @@ 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", "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");
diff --git a/t/linkify.t b/t/linkify.t
index 82f5f368b..2ed3face3 100755
--- a/t/linkify.t
+++ b/t/linkify.t
@@ -13,8 +13,10 @@ sub linkify ($$$$) {
# This is what linkify and htmllink need set right now to work.
# This could change, if so, update it..
%IkiWiki::pagecase=();
+ %IkiWiki::links=();
foreach my $page (@existing_pages) {
$IkiWiki::pagecase{lc $page}=$page;
+ $IkiWiki::links{$page}=[];
$IkiWiki::renderedfiles{"$page.mdwn"}=$page;
}
%IkiWiki::config=IkiWiki::defaultconfig();