From 1b4571acd57294e4048e0dc61b1146cf4310913e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 16 May 2017 08:25:53 +0100 Subject: Add a test-case for Markdown options --- t/mdwn.t | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 t/mdwn.t (limited to 't') diff --git a/t/mdwn.t b/t/mdwn.t new file mode 100755 index 000000000..93b8bd8e9 --- /dev/null +++ b/t/mdwn.t @@ -0,0 +1,44 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More; +use Encode; + +BEGIN { use_ok("IkiWiki"); } + +%config=IkiWiki::defaultconfig(); +$config{srcdir}=$config{destdir}="/dev/null"; +IkiWiki::loadplugins(); +IkiWiki::checkconfig(); + +is(IkiWiki::htmlize("foo", "foo", "mdwn", + "C. S. Lewis wrote books\n"), + "

C. S. Lewis wrote books

\n", "alphalist off by default"); + +$config{mdwn_alpha_lists} = 1; +like(IkiWiki::htmlize("foo", "foo", "mdwn", + "A. One\n". + "B. Two\n"), + qr{A. One\sB. Two

\n}, "alphalist can be disabled"); + +like(IkiWiki::htmlize("foo", "foo", "mdwn", + "This works[^1]\n\n[^1]: Sometimes it doesn't.\n"), + qr{

This works\^1}, "footnotes can be disabled"); + +$config{mdwn_footnotes} = 1; +like(IkiWiki::htmlize("foo", "foo", "mdwn", + "This works[^1]\n\n[^1]: Sometimes it doesn't.\n"), + qr{

This works