aboutsummaryrefslogtreecommitdiff
path: root/t/rst.t
blob: 7908c0fb2a0d780d3bb2b53155f39d77f3bf1186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl
use warnings;
use strict;

BEGIN {
	if (system("python3 -c 'import docutils.core'") != 0) {
		eval 'use Test::More skip_all => "docutils not available"';
	}
}

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();

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*});