Commit b3041d62 authored by Fred Drake's avatar Fred Drake

Update the expected bytecodes to reflect the merger of the beginScope and
rawAttrs bytecodes.
parent 4cd37022
...@@ -218,8 +218,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -218,8 +218,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_define_1(self): def check_define_1(self):
self._run_check("<p tal:define='xyzzy string:spam'></p>", [ self._run_check("<p tal:define='xyzzy string:spam'></p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:define': 'xyzzy string:spam'},)),
('rawAttrs', ({'tal:define': 'xyzzy string:spam'},)),
('setLocal', ('xyzzy', '$string:spam$')), ('setLocal', ('xyzzy', '$string:spam$')),
('startTag', ('p', [('tal:define', 'xyzzy string:spam', 'tal')])), ('startTag', ('p', [('tal:define', 'xyzzy string:spam', 'tal')])),
rawtext('</p>'), rawtext('</p>'),
...@@ -229,8 +228,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -229,8 +228,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_define_2(self): def check_define_2(self):
self._run_check("<p tal:define='local xyzzy string:spam'></p>", [ self._run_check("<p tal:define='local xyzzy string:spam'></p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:define': 'local xyzzy string:spam'},)),
('rawAttrs', ({'tal:define': 'local xyzzy string:spam'},)),
('setLocal', ('xyzzy', '$string:spam$')), ('setLocal', ('xyzzy', '$string:spam$')),
('startTag', ('p', ('startTag', ('p',
[('tal:define', 'local xyzzy string:spam', 'tal')])), [('tal:define', 'local xyzzy string:spam', 'tal')])),
...@@ -241,8 +239,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -241,8 +239,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_define_3(self): def check_define_3(self):
self._run_check("<p tal:define='global xyzzy string:spam'></p>", [ self._run_check("<p tal:define='global xyzzy string:spam'></p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:define': 'global xyzzy string:spam'},)),
('rawAttrs', ({'tal:define': 'global xyzzy string:spam'},)),
('setGlobal', ('xyzzy', '$string:spam$')), ('setGlobal', ('xyzzy', '$string:spam$')),
('startTag', ('p', ('startTag', ('p',
[('tal:define', 'global xyzzy string:spam', 'tal')])), [('tal:define', 'global xyzzy string:spam', 'tal')])),
...@@ -253,8 +250,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -253,8 +250,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_define_4(self): def check_define_4(self):
self._run_check("<p tal:define='x string:spam; y x'></p>", [ self._run_check("<p tal:define='x string:spam; y x'></p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:define': 'x string:spam; y x'},)),
('rawAttrs', ({'tal:define': 'x string:spam; y x'},)),
('setLocal', ('x', '$string:spam$')), ('setLocal', ('x', '$string:spam$')),
('setLocal', ('y', '$x$')), ('setLocal', ('y', '$x$')),
('startTag', ('p', [('tal:define', 'x string:spam; y x', 'tal')])), ('startTag', ('p', [('tal:define', 'x string:spam; y x', 'tal')])),
...@@ -265,8 +261,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -265,8 +261,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_define_5(self): def check_define_5(self):
self._run_check("<p tal:define='x string:;;;;; y x'></p>", [ self._run_check("<p tal:define='x string:;;;;; y x'></p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:define': 'x string:;;;;; y x'},)),
('rawAttrs', ({'tal:define': 'x string:;;;;; y x'},)),
('setLocal', ('x', '$string:;;$')), ('setLocal', ('x', '$string:;;$')),
('setLocal', ('y', '$x$')), ('setLocal', ('y', '$x$')),
('startTag', ('p', [('tal:define', 'x string:;;;;; y x', 'tal')])), ('startTag', ('p', [('tal:define', 'x string:;;;;; y x', 'tal')])),
...@@ -278,8 +273,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -278,8 +273,7 @@ class TALGeneratorTestCases(TestCaseBase):
self._run_check( self._run_check(
"<p tal:define='x string:spam; global y x; local z y'></p>", [ "<p tal:define='x string:spam; global y x; local z y'></p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope',
('rawAttrs',
({'tal:define': 'x string:spam; global y x; local z y'},)), ({'tal:define': 'x string:spam; global y x; local z y'},)),
('setLocal', ('x', '$string:spam$')), ('setLocal', ('x', '$string:spam$')),
('setGlobal', ('y', '$x$')), ('setGlobal', ('y', '$x$')),
...@@ -295,8 +289,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -295,8 +289,7 @@ class TALGeneratorTestCases(TestCaseBase):
"<p><span tal:condition='python:1'><b>foo</b></span></p>", [ "<p><span tal:condition='python:1'><b>foo</b></span></p>", [
rawtext('<p>'), rawtext('<p>'),
('setPosition', ((1, 3),)), ('setPosition', ((1, 3),)),
('beginScope', ()), ('beginScope', ({'tal:condition': 'python:1'},)),
('rawAttrs', ({'tal:condition': 'python:1'},)),
('condition', ('$python:1$', ('condition', ('$python:1$',
[('startTag', ('span', [('tal:condition', 'python:1', 'tal')])), [('startTag', ('span', [('tal:condition', 'python:1', 'tal')])),
rawtext('<b>foo</b></span>')])), rawtext('<b>foo</b></span>')])),
...@@ -307,8 +300,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -307,8 +300,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_content_1(self): def check_content_1(self):
self._run_check("<p tal:content='string:foo'>bar</p>", [ self._run_check("<p tal:content='string:foo'>bar</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:content': 'string:foo'},)),
('rawAttrs', ({'tal:content': 'string:foo'},)),
('startTag', ('p', [('tal:content', 'string:foo', 'tal')])), ('startTag', ('p', [('tal:content', 'string:foo', 'tal')])),
('insertText', ('$string:foo$', [rawtext('bar')])), ('insertText', ('$string:foo$', [rawtext('bar')])),
rawtext('</p>'), rawtext('</p>'),
...@@ -318,8 +310,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -318,8 +310,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_content_2(self): def check_content_2(self):
self._run_check("<p tal:content='text string:foo'>bar</p>", [ self._run_check("<p tal:content='text string:foo'>bar</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:content': 'text string:foo'},)),
('rawAttrs', ({'tal:content': 'text string:foo'},)),
('startTag', ('p', [('tal:content', 'text string:foo', 'tal')])), ('startTag', ('p', [('tal:content', 'text string:foo', 'tal')])),
('insertText', ('$string:foo$', [rawtext('bar')])), ('insertText', ('$string:foo$', [rawtext('bar')])),
rawtext('</p>'), rawtext('</p>'),
...@@ -329,8 +320,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -329,8 +320,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_content_3(self): def check_content_3(self):
self._run_check("<p tal:content='structure string:<br>'>bar</p>", [ self._run_check("<p tal:content='structure string:<br>'>bar</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:content': 'structure string:<br>'},)),
('rawAttrs', ({'tal:content': 'structure string:<br>'},)),
('startTag', ('p', ('startTag', ('p',
[('tal:content', 'structure string:<br>', 'tal')])), [('tal:content', 'structure string:<br>', 'tal')])),
('insertStructure', ('insertStructure',
...@@ -342,8 +332,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -342,8 +332,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_replace_1(self): def check_replace_1(self):
self._run_check("<p tal:replace='string:foo'>bar</p>", [ self._run_check("<p tal:replace='string:foo'>bar</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:replace': 'string:foo'},)),
('rawAttrs', ({'tal:replace': 'string:foo'},)),
('insertText', ('$string:foo$', ('insertText', ('$string:foo$',
[('startTag', ('p', [('tal:replace', 'string:foo', 'tal')])), [('startTag', ('p', [('tal:replace', 'string:foo', 'tal')])),
rawtext('bar</p>')])), rawtext('bar</p>')])),
...@@ -353,8 +342,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -353,8 +342,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_replace_2(self): def check_replace_2(self):
self._run_check("<p tal:replace='text string:foo'>bar</p>", [ self._run_check("<p tal:replace='text string:foo'>bar</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:replace': 'text string:foo'},)),
('rawAttrs', ({'tal:replace': 'text string:foo'},)),
('insertText', ('$string:foo$', ('insertText', ('$string:foo$',
[('startTag', ('p', [('startTag', ('p',
[('tal:replace', 'text string:foo', 'tal')])), [('tal:replace', 'text string:foo', 'tal')])),
...@@ -365,8 +353,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -365,8 +353,7 @@ class TALGeneratorTestCases(TestCaseBase):
def check_replace_3(self): def check_replace_3(self):
self._run_check("<p tal:replace='structure string:<br>'>bar</p>", [ self._run_check("<p tal:replace='structure string:<br>'>bar</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:replace': 'structure string:<br>'},)),
('rawAttrs', ({'tal:replace': 'structure string:<br>'},)),
('insertStructure', ('$string:<br>$', {}, ('insertStructure', ('$string:<br>$', {},
[('startTag', ('p', [('startTag', ('p',
[('tal:replace', 'structure string:<br>', 'tal')])), [('tal:replace', 'structure string:<br>', 'tal')])),
...@@ -378,14 +365,12 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -378,14 +365,12 @@ class TALGeneratorTestCases(TestCaseBase):
self._run_check("<p tal:repeat='x python:(1,2,3)'>" self._run_check("<p tal:repeat='x python:(1,2,3)'>"
"<span tal:replace='x'>dummy</span></p>", [ "<span tal:replace='x'>dummy</span></p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope', ({'tal:repeat': 'x python:(1,2,3)'},)),
('rawAttrs', ({'tal:repeat': 'x python:(1,2,3)'},)),
('loop', ('x', '$python:(1,2,3)$', ('loop', ('x', '$python:(1,2,3)$',
[('startTag', ('p', [('startTag', ('p',
[('tal:repeat', 'x python:(1,2,3)', 'tal')])), [('tal:repeat', 'x python:(1,2,3)', 'tal')])),
('setPosition', ((1, 33),)), ('setPosition', ((1, 33),)),
('beginScope', ()), ('beginScope', ({'tal:replace': 'x'},)),
('rawAttrs', ({'tal:replace': 'x'},)),
('insertText', ('$x$', ('insertText', ('$x$',
[('startTag', ('span', [('tal:replace', 'x', 'tal')])), [('startTag', ('span', [('tal:replace', 'x', 'tal')])),
rawtext('dummy</span>')])), rawtext('dummy</span>')])),
...@@ -399,8 +384,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -399,8 +384,7 @@ class TALGeneratorTestCases(TestCaseBase):
"'href string:http://www.zope.org; x string:y'>" "'href string:http://www.zope.org; x string:y'>"
"link</a>", [ "link</a>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope',
('rawAttrs',
({'tal:attributes': 'href string:http://www.zope.org; x string:y', ({'tal:attributes': 'href string:http://www.zope.org; x string:y',
'name': 'bar', 'href': 'foo'},)), 'name': 'bar', 'href': 'foo'},)),
('startTag', ('a', ('startTag', ('a',
...@@ -417,8 +401,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -417,8 +401,7 @@ class TALGeneratorTestCases(TestCaseBase):
self._run_check("<p tal:replace='structure string:<img>' " self._run_check("<p tal:replace='structure string:<img>' "
"tal:attributes='src string:foo.png'>duh</p>", [ "tal:attributes='src string:foo.png'>duh</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope',
('rawAttrs',
({'tal:attributes': 'src string:foo.png', ({'tal:attributes': 'src string:foo.png',
'tal:replace': 'structure string:<img>'},)), 'tal:replace': 'structure string:<img>'},)),
('insertStructure', ('$string:<img>$', ('insertStructure', ('$string:<img>$',
...@@ -434,8 +417,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -434,8 +417,7 @@ class TALGeneratorTestCases(TestCaseBase):
self._run_check("<p tal:on-error='string:error' " self._run_check("<p tal:on-error='string:error' "
"tal:content='notHere'>okay</p>", [ "tal:content='notHere'>okay</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope',
('rawAttrs',
({'tal:content': 'notHere', 'tal:on-error': 'string:error'},)), ({'tal:content': 'notHere', 'tal:on-error': 'string:error'},)),
('onError', ('onError',
([('startTag', ('p', ([('startTag', ('p',
...@@ -455,8 +437,7 @@ class TALGeneratorTestCases(TestCaseBase): ...@@ -455,8 +437,7 @@ class TALGeneratorTestCases(TestCaseBase):
self._run_check("<p tal:on-error='string:error' " self._run_check("<p tal:on-error='string:error' "
"tal:replace='notHere'>okay</p>", [ "tal:replace='notHere'>okay</p>", [
('setPosition', ((1, 0),)), ('setPosition', ((1, 0),)),
('beginScope', ()), ('beginScope',
('rawAttrs',
({'tal:replace': 'notHere', 'tal:on-error': 'string:error'},)), ({'tal:replace': 'notHere', 'tal:on-error': 'string:error'},)),
('onError', ('onError',
([('insertText', ('$notHere$', ([('insertText', ('$notHere$',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment