[ZPT] CVS: Packages/TAL - test_htmltalparser.py:1.5

guido@digicool.com guido@digicool.com
Mon, 26 Mar 2001 15:02:50 -0500 (EST)


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

Modified Files:
	test_htmltalparser.py 
Log Message:
Fix the output after Evan's optimization patch.



--- Updated File test_htmltalparser.py in package Packages/TAL --
--- test_htmltalparser.py	2001/03/26 17:02:50	1.4
+++ test_htmltalparser.py	2001/03/26 20:02:49	1.5
@@ -30,86 +30,34 @@
     def check_code_simple_identity(self):
         self._run_check("""<html a='b' b="c" c=d><title>My Title</html>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
-            ('rawtext', '<html a="b" b="c" c="d">'),
-            ('setPosition', (1, 22)),
-            ('rawtext', '<title>My Title</title></html>'),
+            ('rawtext', '<html a="b" b="c" c="d">'
+                        '<title>My Title</title></html>'),
             ])
 
     def check_code_implied_list_closings(self):
         self._run_check("""<ul><li><p><p><li></ul>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
-            ('rawtext', '<ul>'),
-            ('setPosition', (1, 4)),
-            ('rawtext', '<li>'),
-            ('setPosition', (1, 8)),
-            ('rawtext', '<p></p>'),
-            ('setPosition', (1, 11)),
-            ('rawtext', '<p></p></li>'),
-            ('setPosition', (1, 14)),
-            ('rawtext', '<li></li></ul>'),
+            ('rawtext', '<ul><li><p></p><p></p></li><li></li></ul>'),
             ])
         self._run_check("""<dl><dt><dt><dd><dd><ol><li><li></ol></dl>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
-            ('rawtext', '<dl>'),
-            ('setPosition', (1, 4)),
-            ('rawtext', '<dt></dt>'),
-            ('setPosition', (1, 8)),
-            ('rawtext', '<dt></dt>'),
-            ('setPosition', (1, 12)),
-            ('rawtext', '<dd></dd>'),
-            ('setPosition', (1, 16)),
-            ('rawtext', '<dd>'),
-            ('setPosition', (1, 20)),
-            ('rawtext', '<ol>'),
-            ('setPosition', (1, 24)),
-            ('rawtext', '<li></li>'),
-            ('setPosition', (1, 28)),
-            ('rawtext', '<li></li></ol></dd></dl>'),
+            ('rawtext', '<dl><dt></dt><dt></dt><dd></dd>'
+                        '<dd><ol><li></li><li></li></ol></dd></dl>'),
             ])
 
     def check_code_implied_table_closings(self):
         self._run_check("""<p>text <table><tr><th>head\t<tr><td>cell\t"""
                         """<table><tr><td>cell \n \t \n<tr>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
-            ('rawtext', '<p>text</p> '),
-            ('setPosition', (1, 8)),
-            ('rawtext', '<table>'),
-            ('setPosition', (1, 15)),
-            ('rawtext', '<tr>'),
-            ('setPosition', (1, 19)),
-            ('rawtext', '<th>head</th></tr>\t'),
-            ('setPosition', (1, 28)),
-            ('rawtext', '<tr>'),
-            ('setPosition', (1, 32)),
-            ('rawtext', '<td>cell\t'),
-            ('setPosition', (1, 41)),
-            ('rawtext', '<table>'),
-            ('setPosition', (1, 48)),
-            ('rawtext', '<tr>'),
-            ('setPosition', (1, 52)),
-            ('rawtext', '<td>cell</td></tr> \n \t \n'),
-            ('setPosition', (3, 0)),
-            ('rawtext', '<tr></tr></table></td></tr></table>'),
+            ('rawtext', '<p>text</p> <table><tr><th>head</th>'
+                        '</tr>\t<tr><td>cell\t<table><tr><td>cell</td>'
+                        '</tr> \n \t \n<tr></tr></table></td></tr></table>'),
             ])
         self._run_check("""<table><tr><td>cell """
                         """<table><tr><td>cell </table></table>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
-            ('rawtext', '<table>'),
-            ('setPosition', (1, 7)),
-            ('rawtext', '<tr>'),
-            ('setPosition', (1, 11)),
-            ('rawtext', '<td>cell '),
-            ('setPosition', (1, 20)),
-            ('rawtext', '<table>'),
-            ('setPosition', (1, 27)),
-            ('rawtext', '<tr>'),
-            ('setPosition', (1, 31)),
-            ('rawtext', '<td>cell</td></tr> </table></td></tr></table>'),
+            ('rawtext', '<table><tr><td>cell <table><tr><td>cell</td></tr>'
+                        ' </table></td></tr></table>'),
             ])
 
     def check_code_bad_nesting(self):
@@ -120,7 +68,6 @@
     def check_code_attr_syntax(self):
         output = [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
             ('rawtext', '<a b="v" c="v" d="v" e></a>'),
             ]
         self._run_check("""<a b='v' c="v" d=v e>""", output)
@@ -132,12 +79,10 @@
         self._run_check(
             """<a b='xxx\n\txxx' c="yyy\t\nyyy" d='\txyz\n'>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
             ('rawtext',
              '<a b="xxx\n\txxx" c="yyy\t\nyyy" d="\txyz\n"></a>')])
         self._run_check("""<a b='' c="" d=>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
             ('rawtext', '<a b="" c="" d=""></a>'),
             ])
 
@@ -145,29 +90,24 @@
         # we expect entities *not* to be replaced by HTLMParser!
         self._run_check("""<a b='&amp;&gt;&lt;&quot;&apos;'>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
             ('rawtext', '<a b="&amp;&gt;&lt;&quot;\'"></a>'),
             ])
         self._run_check("""<a b='\"'>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
             ('rawtext', "<a b='\"'></a>"),
             ])
         self._run_check("""<a b='&'>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
             ('rawtext', '<a b="&amp;"></a>'),
             ])
         self._run_check("""<a b='<'>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
             ('rawtext', '<a b="&lt;"></a>'),
             ])
 
     def check_code_attr_funky_names(self):
         self._run_check("""<a a.b='v' c:d=v e-f=v>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
             ('rawtext', '<a a.b="v" c:d="v" e-f="v"></a>'),
             ])
 
@@ -180,10 +120,7 @@
     def check_code_short_endtags(self):
         self._run_check("""<html><img/></html>""", [
             ('version', TAL_VERSION),
-            ('setPosition', (1, 0)),
-            ('rawtext', '<html>'),
-            ('setPosition', (1, 6)),
-            ('rawtext', '<img/></html>'),
+            ('rawtext', '<html><img/></html>'),
             ])