aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-13 02:03:43 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-13 02:03:43 +0000
commit4b36dee35a55b08d6d6f3bb3840220a4956f2540 (patch)
tree4202c4fa32c2ec537e065072e45b4bb9344b1147 /t
parent85ecbc6c4ea3af0b39034d985d4ca4adb243d94f (diff)
downloadikiwiki-4b36dee35a55b08d6d6f3bb3840220a4956f2540.tar
ikiwiki-4b36dee35a55b08d6d6f3bb3840220a4956f2540.tar.gz
* The last release accidentially installed ikiwiki as ikiwiki.pl, now fixed.
* Add --version. * Man page format fixups. * Add a %pagecase which maps lower-case page names to the actual case used in the filename. Use this in bestlinks calculation instead of forcing the link to lowercase. * Also use %pagecase in various other places that want to check if a page with a given name exists. * This means that links to pages with mixed case names will now work, even if the link is in some other case mixture, and mixed case pages should be fully supported throughout ikiwiki. * Recommend rebuilding wikis on upgrade to this version.
Diffstat (limited to 't')
-rwxr-xr-xt/bestlink.t9
-rwxr-xr-xt/linkify.t4
2 files changed, 8 insertions, 5 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");
diff --git a/t/linkify.t b/t/linkify.t
index d1d02cd27..82f5f368b 100755
--- a/t/linkify.t
+++ b/t/linkify.t
@@ -12,9 +12,9 @@ sub linkify ($$$$) {
# This is what linkify and htmllink need set right now to work.
# This could change, if so, update it..
- %IkiWiki::links=();
+ %IkiWiki::pagecase=();
foreach my $page (@existing_pages) {
- $IkiWiki::links{$page}=[];
+ $IkiWiki::pagecase{lc $page}=$page;
$IkiWiki::renderedfiles{"$page.mdwn"}=$page;
}
%IkiWiki::config=IkiWiki::defaultconfig();