From: Simon McVittie Date: Sun, 14 Sep 2014 14:43:59 +0000 (+0100) Subject: extend rst test to cover a fixed bug X-Git-Tag: 3.20140916~33 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/0490ead761c64ce91123d21bea4b5ab14980173e?ds=sidebyside;hp=24a5dceb01e102d44b4294ae4ba73a082e0a71b6 extend rst test to cover a fixed bug --- diff --git a/doc/bugs/rst_fails_on_file_containing_only_a_number.mdwn b/doc/bugs/rst_fails_on_file_containing_only_a_number.mdwn index 99e46aac9..57e0cf6aa 100644 --- a/doc/bugs/rst_fails_on_file_containing_only_a_number.mdwn +++ b/doc/bugs/rst_fails_on_file_containing_only_a_number.mdwn @@ -27,3 +27,5 @@ throwing code..): > On second thought, this was a bug in ikiwiki, it should be transmitting > that as a string. Fixed in external.pm --[[Joey]] + +>> [[done]] a while ago, then. I've added a regression test now. --[[smcv]] diff --git a/t/rst.t b/t/rst.t index 4e0c4b747..a72c4681c 100755 --- a/t/rst.t +++ b/t/rst.t @@ -8,7 +8,7 @@ BEGIN { } } -use Test::More tests => 2; +use Test::More tests => 3; BEGIN { use_ok("IkiWiki"); } @@ -19,4 +19,8 @@ $config{add_plugins}=[qw(rst)]; IkiWiki::loadplugins(); IkiWiki::checkconfig(); -ok(IkiWiki::htmlize("foo", "foo", "rst", "foo\n") =~ m{\s*

foo

\s*}); +like(IkiWiki::htmlize("foo", "foo", "rst", "foo\n"), qr{\s*

foo

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