]> sipb.mit.edu Git - ikiwiki.git/commitdiff
extend rst test to cover a fixed bug
authorSimon McVittie <smcv@debian.org>
Sun, 14 Sep 2014 14:43:59 +0000 (15:43 +0100)
committerSimon McVittie <smcv@debian.org>
Sun, 14 Sep 2014 14:47:42 +0000 (15:47 +0100)
doc/bugs/rst_fails_on_file_containing_only_a_number.mdwn
t/rst.t

index 99e46aac9c4018f67366152ec1c135ca51f84776..57e0cf6aafeaab8bb7113dfbf09de7a8c9a98fc7 100644 (file)
@@ -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 4e0c4b74775842cc930aca7c63dd501a34993e64..a72c4681cbf3bd0e13817c730338761a5537e7b8 100755 (executable)
--- 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*<p>foo</p>\s*});
+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*});