ikiwiki/t/rst.t

27 lines
671 B
Perl
Raw Normal View History

#!/usr/bin/perl
use warnings;
use strict;
BEGIN {
if (system("python -c 'import docutils.core'") != 0) {
eval 'use Test::More skip_all => "docutils not available"';
}
}
2014-09-14 16:43:59 +02:00
use Test::More tests => 3;
BEGIN { use_ok("IkiWiki"); }
%config=IkiWiki::defaultconfig();
$config{srcdir}=$config{destdir}="/dev/null";
$config{libdir}=".";
$config{add_plugins}=[qw(rst)];
IkiWiki::loadplugins();
IkiWiki::checkconfig();
2014-09-14 16:43:59 +02:00
like(IkiWiki::htmlize("foo", "foo", "rst", "foo\n"), qr{\s*<p>foo</p>\s*});
# regression test for [[bugs/rst fails on file containing only a number]]
my $html = IkiWiki::htmlize("foo", "foo", "rst", "11");
$html =~ s/<[^>]*>//g;
like($html, qr{\s*11\s*});