[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/translation.txt Add failing tests for CDATA and ${..} expansion

Wichert Akkerman wichert at wiggy.net
Tue Aug 12 03:48:19 EDT 2008


Log message for revision 89702:
  Add failing tests for CDATA and ${..} expansion

Changed:
  U   z3c.pt/trunk/src/z3c/pt/translation.txt

-=-
Modified: z3c.pt/trunk/src/z3c/pt/translation.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/translation.txt	2008-08-12 07:47:37 UTC (rev 89701)
+++ z3c.pt/trunk/src/z3c/pt/translation.txt	2008-08-12 07:48:19 UTC (rev 89702)
@@ -44,6 +44,19 @@
       <img alt="La Peña" />
     </div>
 
+:: CDATA blocks
+  >>> print render("""\
+  ... <div xmlns="http://www.w3.org/1999/xhtml">
+  ... /* <![CDATA[ */
+  ...   This is protected
+  ... /* ]]> */
+  ... </div>""", translate_xml)
+    <div>
+      /* <![CDATA[ */
+      This is protected
+      /* ]]> */
+    </div>
+
 :: Variables containing markup
 
   >>> print render("""\
@@ -54,6 +67,29 @@
       Hello, <em>World</em>!
     </div>
 
+:: Variable expansion must preserve XML validity
+
+  >>> print render("""\
+  ... <div xmlns="http://www.w3.org/1999/xhtml">
+  ...   ${message}
+  ... </div>""", translate_xml, message="Hello, <em>World!")
+  Traceback (most recent call last):
+  ...
+
+:: Unless we are in a CDATA block
+
+  >>> print render("""\
+  ... <div xmlns="http://www.w3.org/1999/xhtml">
+  ... /* <![CDATA[ */
+  ...   ${message}
+  ... /* ]]> */
+  ... </div>""", translate_xml, message="Hello, <em>World!")
+    <div>
+      /* <![CDATA[ */
+      Hello, <em>World!
+      /* ]]> */
+    </div>
+
 Literals
 --------
 



More information about the Checkins mailing list