X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/cefbe6210f4e89984bb40062e4f9787b7372dd52..fa52a730ff3b30c7d2cdd8cd5f9c8c25a0c0a2a5:/t/linkify.t diff --git a/t/linkify.t b/t/linkify.t index 4de2b51ae..18b47dcb7 100755 --- a/t/linkify.t +++ b/t/linkify.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 13; +use Test::More tests => 15; BEGIN { use_ok("IkiWiki"); } @@ -22,6 +22,7 @@ sub linkify ($$$$) { $renderedfiles{"$page.mdwn"}=[$page]; } %config=IkiWiki::defaultconfig(); + $config{cgiurl}="http://somehost/ikiwiki.cgi"; return IkiWiki::linkify($lpage, $page, $content); } @@ -75,7 +76,8 @@ ok(links_to("bar", linkify("foo", "foo", "link to [[some_page|bar]] ok", ["foo", ok(links_text("some page", linkify("foo", "foo", "link to [[some_page|bar]] ok", ["foo", "bar"])), "named link text"); ok(links_to("bar", linkify("foo", "foo", "link to [[some page|bar]] ok", ["foo", "bar"])), "named link, with whitespace"); ok(links_text("some page", linkify("foo", "foo", "link to [[some page|bar]] ok", ["foo", "bar"])), "named link text, with whitespace"); +ok(links_text("0", linkify("foo", "foo", "link to [[0|bar]] ok", ["foo", "bar"])), "named link to 0"); ok(links_text("Some long, & complex page name.", linkify("foo", "foo", "link to [[Some long, & complex page name.|bar]] ok, and this is not a link]] here", ["foo", "bar"])), "complex named link text"); ok(links_to("foo/bar", linkify("foo/item", "foo", "link to [[bar]] ok", ["foo", "foo/item", "foo/bar"])), "inline page link"); ok(links_to("bar", linkify("foo", "foo", "link to [[bar]] ok", ["foo", "foo/item", "foo/bar"])), "same except not inline"); - +ok(links_to("bar#baz", linkify("foo", "foo", "link to [[bar#baz]] ok", ["foo", "bar"])), "anchor link");