]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - t/htmlize.t
response
[git.ikiwiki.info.git] / t / htmlize.t
index 465004bc1090f0ee1890af3c3fd489fdac7b913e..070fbf9584740a1f5b65e37c40e0a79c9bb5ad69 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
 #!/usr/bin/perl
 use warnings;
 use strict;
-use Test::More tests => 4;
+use Test::More tests => 5;
 use Encode;
 
 BEGIN { use_ok("IkiWiki"); }
 use Encode;
 
 BEGIN { use_ok("IkiWiki"); }
@@ -10,10 +10,13 @@ BEGIN { use_ok("IkiWiki::Render"); }
 # Initialize htmlscrubber plugin
 %IkiWiki::config=IkiWiki::defaultconfig();
 $IkiWiki::config{srcdir}=$IkiWiki::config{destdir}="/dev/null";
 # Initialize htmlscrubber plugin
 %IkiWiki::config=IkiWiki::defaultconfig();
 $IkiWiki::config{srcdir}=$IkiWiki::config{destdir}="/dev/null";
+IkiWiki::loadplugins();
 IkiWiki::checkconfig();
 
 IkiWiki::checkconfig();
 
-is(IkiWiki::htmlize(".mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n",
+is(IkiWiki::htmlize("mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n",
        "basic");
        "basic");
-is(IkiWiki::htmlize(".mdwn", IkiWiki::readfile("t/test1.mdwn")),
+is(IkiWiki::htmlize("mdwn", IkiWiki::readfile("t/test1.mdwn")),
        Encode::decode_utf8(qq{<p><img src="../images/o.jpg" alt="o" title="&oacute;" />\nóóóóó</p>\n}),
        "utf8; bug #373203");
        Encode::decode_utf8(qq{<p><img src="../images/o.jpg" alt="o" title="&oacute;" />\nóóóóó</p>\n}),
        "utf8; bug #373203");
+ok(IkiWiki::htmlize("mdwn", IkiWiki::readfile("t/test2.mdwn")),
+       "this file crashes markdown if it's fed in as decoded utf-8");