Commits

Shlomi Fish committed 432d2cb

Add trailing space checks for t/fiction too.

  • Participants
  • Parent commits cfbcfe4

Comments (0)

Files changed (3)

perl/modules/XML-Grammar-Fiction/t/fiction/data/proto-text/with-comment-with-newlines.txt

+<body id="index">
+
+<title>David vs. Goliath - Part I</title>
+
+<s id="top">
+
+<title>The Top Section</title>
+
+<!--
+David has Green hair here
+-->
+
+King <a href="http://en.wikipedia.org/wiki/David">David</a> and Goliath were standing by each other.
+
+David said unto Goliath: "I will shoot you. I <b>swear</b> I will"
+
+<s id="goliath">
+
+<title>Goliath's Response</title>
+
+<!-- Goliath has to reply to that.
+New line in comment.
+Another new line.
+-->
+
+Goliath was not amused.
+
+He said to David: "Oh, really. <i>David</i>, the red-headed!".
+
+David started listing Goliath's disadvantages:
+
+<blockquote lang="fr-FR" id="my_blockquote">
+
+<ol>
+
+<li>
+
+You're slow.
+
+</li>
+
+<li>
+
+You're big.
+
+</li>
+
+<li>
+
+You're stupid.
+
+</li>
+
+</ol>
+
+Goliath was insulted and told David he should use bullets for the points,
+instead:
+
+<ul>
+
+<li>
+
+David.
+
+</li>
+
+<li>
+
+Saul.
+
+</li>
+
+<li>
+
+Jonathan.
+
+</li>
+
+<li>
+
+Michal.
+
+</li>
+
+<li>
+
+Meyrav.
+
+</li>
+
+</ul>
+
+</blockquote>
+
+</s>
+
+</s>
+
+</body>
+

perl/modules/XML-Grammar-Fiction/t/fiction/data/xml/with-comment-with-newlines.xml

+<?xml version='1.0' encoding='utf-8'?>
+<document xmlns="http://web-cpan.berlios.de/modules/XML-Grammar-Fortune/fiction-xml-0.2/" xmlns:xlink="http://www.w3.org/1999/xlink" version="0.2">
+    <head>
+    </head>
+    <body xml:id="index">
+    <title>David vs. Goliath - Part I</title>
+    <section xml:id="top">
+    <title>The Top Section</title>
+    <!-- David has Green hair here -->
+    <p>
+    King <span xlink:href="http://en.wikipedia.org/wiki/David">David</span> and Goliath were standing by each other.
+    </p>
+    <p>
+    David said unto Goliath: "I will shoot you. I <b>swear</b> I will"
+    </p>
+    <section xml:id="goliath">
+    <title>Goliath's Response</title>
+    <!-- Goliath has to reply to that.
+New line in comment.
+Another new line.
+    -->
+    <p>
+    Goliath was not amused.
+    </p>
+    <p>
+    He said to David: "Oh, really. <i>David</i>, the red-headed!".
+    </p>
+    <p>
+    David started listing Goliath's disadvantages:
+    </p>
+    <blockquote xml:lang="fr-FR" xml:id="my_blockquote">
+    <ol>
+    <li>
+    <p>
+    You're slow.
+    </p>
+    </li>
+    <li>
+    <p>
+    You're big.
+    </p>
+    </li>
+    <li>
+    <p>
+    You're stupid.
+    </p>
+    </li>
+    </ol>
+    <p>
+    Goliath was insulted and told David he should use bullets for the
+    points, instead:
+    </p>
+    <ul>
+    <li>
+    <p>
+    David.
+    </p>
+    </li>
+    <li>
+    <p>
+    Saul.
+    </p>
+    </li>
+    <li>
+    <p>
+    Jonathan.
+    </p>
+    </li>
+    <li>
+    <p>
+    Michal.
+    </p>
+    </li>
+    <li>
+    <p>
+    Meyrav.
+    </p>
+    </li>
+    </ul>
+    </blockquote>
+    </section>
+    </section>
+</body>
+</document>

perl/modules/XML-Grammar-Fiction/t/fiction/proto-text-to-xml-using-custom-parser.t

 use strict;
 use warnings;
 
-use Test::More tests => 29;
+use Test::More tests => 46;
 
 use lib './t/lib';
 use XmlGrammarTestXML qw(my_is_xml);
     a-href-with-id-and-lang
     with-blockquote-with-lang-and-id
     with-style-tag-at-start-of-paragraph
+    with-comment-with-newlines
     ));
 
-# TEST:$num_texts=14
+# TEST:$num_texts=15
 
 my $grammar = XML::Grammar::Fiction::FromProto->new({
         parser_class => "XML::Grammar::Fiction::FromProto::Parser::QnD",
     }
 
     # TEST*$num_texts
+    unlike ($got_xml, qr{[ \t+]$}ms, "No trailing space in \"$fn\"");
+
+    # TEST*$num_texts
     my_is_xml (
         [string => $got_xml,],
         [string => load_xml("t/fiction/data/xml/$fn.xml"),],