aboutsummaryrefslogtreecommitdiff
path: root/t/rst.t
blob: a72c4681cbf3bd0e13817c730338761a5537e7b8 (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("python -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*});