]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - t/htmlize.t
* Patch from James Westby to add an actions option to inline; this
[git.ikiwiki.info.git] / t / htmlize.t
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use Test::More tests => 5;
5 use Encode;
7 BEGIN { use_ok("IkiWiki"); }
8 BEGIN { use_ok("IkiWiki::Render"); }
10 # Initialize htmlscrubber plugin
11 %IkiWiki::config=IkiWiki::defaultconfig();
12 $IkiWiki::config{srcdir}=$IkiWiki::config{destdir}="/dev/null";
13 IkiWiki::loadplugins();
14 IkiWiki::checkconfig();
16 is(IkiWiki::htmlize("foo", "mdwn", "foo\n\nbar\n"), "<p>foo</p>\n\n<p>bar</p>\n",
17         "basic");
18 is(IkiWiki::htmlize("foo", "mdwn", IkiWiki::readfile("t/test1.mdwn")),
19         Encode::decode_utf8(qq{<p><img src="../images/o.jpg" alt="o" title="&oacute;" />\nóóóóó</p>\n}),
20         "utf8; bug #373203");
21 ok(IkiWiki::htmlize("foo", "mdwn", IkiWiki::readfile("t/test2.mdwn")),
22         "this file crashes markdown if it's fed in as decoded utf-8");