X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/49de9594b71159d2a1755c80a096f1886b5fb05c..62890d911ae75eaf2d2622c1c33a5d956d33e9d8:/t/color.t
diff --git a/t/color.t b/t/color.t
index c5c14f6aa..bd353b58e 100755
--- a/t/color.t
+++ b/t/color.t
@@ -10,6 +10,14 @@ BEGIN { use_ok("IkiWiki::Render"); }
%config=IkiWiki::defaultconfig();
$config{srcdir}=$config{destdir}="/dev/null";
+my $installed = $ENV{INSTALLED_TESTS};
+
+unless ($installed) {
+ $config{templatedir} = "templates";
+ $config{underlaydir} = "underlays/basewiki";
+ $config{underlaydirbase} = "underlays";
+}
+
sub render {
my $content = shift;
$IkiWiki::pagesources{foo} = "foo.mdwn";
@@ -25,10 +33,10 @@ sub render {
foreach my $scrub (0, 1) {
if ($scrub) {
- $config{add_plugins}=[qw(color htmlscrubber)];
+ $config{add_plugins}=[qw(color htmlscrubber toc)];
}
else {
- $config{add_plugins}=[qw(color)];
+ $config{add_plugins}=[qw(color toc)];
}
IkiWiki::loadplugins();
@@ -44,6 +52,9 @@ foreach my $scrub (0, 1) {
qr{(?s)Hi});
like(render('[[!color foreground="x; pwned: exploit" text="Hi"]]'),
qr{(?s)Hi});
+
+ like(render("[[!toc ]]\n\n## [[!color foreground=red text=Important]]"),
+ qr{Important});
}
done_testing();