2011-10-22 20:46:42 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
BEGIN {
|
2018-03-04 11:56:18 +01:00
|
|
|
if (system("python3 -c 'import docutils.core'") != 0) {
|
2011-10-22 20:46:42 +02:00
|
|
|
eval 'use Test::More skip_all => "docutils not available"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-14 16:43:59 +02:00
|
|
|
use Test::More tests => 3;
|
2011-10-22 20:46:42 +02:00
|
|
|
|
|
|
|
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*});
|