summaryrefslogtreecommitdiff
path: root/t/linkify.t
diff options
context:
space:
mode:
Diffstat (limited to 't/linkify.t')
-rwxr-xr-xt/linkify.t12
1 files changed, 6 insertions, 6 deletions
diff --git a/t/linkify.t b/t/linkify.t
index 2ed3face3..74747e127 100755
--- a/t/linkify.t
+++ b/t/linkify.t
@@ -3,6 +3,8 @@ use warnings;
use strict;
use Test::More tests => 13;
+BEGIN { use_ok("IkiWiki"); }
+
sub linkify ($$$$) {
my $lpage=shift;
my $page=shift;
@@ -13,13 +15,13 @@ 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=();
+ %links=();
foreach my $page (@existing_pages) {
$IkiWiki::pagecase{lc $page}=$page;
- $IkiWiki::links{$page}=[];
- $IkiWiki::renderedfiles{"$page.mdwn"}=$page;
+ $links{$page}=[];
+ $renderedfiles{"$page.mdwn"}=$page;
}
- %IkiWiki::config=IkiWiki::defaultconfig();
+ %config=IkiWiki::defaultconfig();
return IkiWiki::linkify($lpage, $page, $content);
}
@@ -64,8 +66,6 @@ sub links_text ($$) {
}
-BEGIN { use_ok("IkiWiki::Render"); }
-
ok(links_to("bar", linkify("foo", "foo", "link to [[bar]] ok", ["foo", "bar"])), "ok link");
ok(not_links_to("bar", linkify("foo", "foo", "link to \\[[bar]] ok", ["foo", "bar"])), "escaped link");
ok(links_to("page=bar", linkify("foo", "foo", "link to [[bar]] ok", ["foo"])), "broken link");