[ZPT] CVS: Zope/lib/python/TAL/tests - test_htmltalparser.py:1.25.32.1

Matthew T. Kromer matt@zope.com
Fri, 10 May 2002 16:30:46 -0400


Update of /cvs-repository/Zope/lib/python/TAL/tests
In directory cvs.zope.org:/tmp/cvs-serv15073

Modified Files:
      Tag: Zope-2_5-branch
	test_htmltalparser.py 
Log Message:
Add test case for TAL processing which currently fails on
<script>
<!--
document.write("</a>");
//->
</script>

even though it shouldn't -- the current CDATA implementation does not respect
HTML comments.


=== Zope/lib/python/TAL/tests/test_htmltalparser.py 1.25 => 1.25.32.1 ===
         self.assertRaises(HTMLTALParser.NestingError, check)
 
+    def check_cdata_mode(self):
+        """This routine should NOT detect an error with an end tag </a> not
+           matching the start <script> tag.  The contents are within a
+           HTML comment, and should be ignored.
+        """
+        s = """<script>\n<!--\ndocument.write("</a>");\n// -->\n</script>"""
+        output = [
+            rawtext(s),
+            ]
+        self._run_check(s, output)
+
     def check_code_attr_syntax(self):
         output = [
             rawtext('<a b="v" c="v" d="v" e></a>'),