[ZPT] CVS: Packages/TAL - test_htmlparser.py:1.4

guido@digicool.com guido@digicool.com
Thu, 22 Mar 2001 12:17:54 -0500 (EST)


Update of /cvs-repository/Packages/TAL/test
In directory korak:/tmp/cvs-serv27949

Modified Files:
	test_htmlparser.py 
Log Message:
Nore tests for the new parser.  (Still not enough!)



--- Updated File test_htmlparser.py in package Packages/TAL --
--- test_htmlparser.py	2001/03/21 22:41:03	1.3
+++ test_htmlparser.py	2001/03/22 17:17:53	1.4
@@ -70,7 +70,7 @@
         else:
             parser.feed(source)
         parser.close()
-        assert parser.get_events() == events, parser.get_events()
+        self.assert_(parser.get_events() == events, parser.get_events())
 
     def _parse_error(self, source):
         def parse(source=source):
@@ -165,7 +165,25 @@
         self._run_check(["<a b='>'", ">"], output)
 
     def check_starttag_junk_chars(self):
+        self._parse_error("<")
+        self._parse_error("<>")
+        self._parse_error("</>")
+        self._parse_error("</")
+        self._parse_error("</a")
+        self._parse_error("</a")
+##        self._parse_error("</a<a>")
+        self._parse_error("<$")
+        self._parse_error("<$>")
+        self._parse_error("<!")
         self._parse_error("<a $>")
+        self._parse_error("<a")
+        self._parse_error("<a foo='bar'")
+        self._parse_error("<a foo='bar")
+        self._parse_error("<a foo='>'")
+        self._parse_error("<a foo='>")
+
+    def check_declaration_junk_chars(self):
+        self._parse_error("<!DOCTYPE foo $ >")
 
     def check_startendtag(self):
         self._run_check("<p/>", [