Commit 1d87aed7 authored by Guido van Rossum's avatar Guido van Rossum

Adapt tests to new syntax

parent cd1773d5
......@@ -3,7 +3,7 @@
<head>dadada</head>
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo as python:1">
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo python:1">
<h1 z:insert="str:This Is The Replaced Title">This Is The Replaced Title</h1>
......@@ -11,27 +11,29 @@
<span z:insert="str:here/id">here/id</span>
<p z:define="x as str:template/title; global five as python:2+3" z:insert="text var:x">template/title</p>
<p z:define="x str:template/title; global five python:2+3" z:insert="text var:x">template/title</p>
<p z:replace="for car in python:['honda', 'subaru', 'acura']">
<p z:repeat="car python:['honda', 'subaru', 'acura']">
honda
</p><p z:replace="for car in python:['honda', 'subaru', 'acura']">
</p><p z:repeat="car python:['honda', 'subaru', 'acura']">
subaru
</p><p z:replace="for car in python:['honda', 'subaru', 'acura']">
</p><p z:repeat="car python:['honda', 'subaru', 'acura']">
acura
</p>
<!-- more examples -->
<ul z:insert="for car in python:['honda', 'subaru', 'acura']">
<ul>
<span z:repeat="car python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">honda</li>
</span><span z:repeat="car python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">subaru</li>
</span><span z:repeat="car python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">acura</li>
</span>
</ul>
<a href="http://python.org" z:attributes="href = python:'http://python.org' ">python</a>
<a href="http://python.org" z:attributes="href python:'http://python.org' ">python</a>
</body>
......
<?xml version="1.0" ?>
<p>
<span xmlns:z="http://xml.zope.org/namespaces/tal" z:define="local x as str:hello brave new world">
<span xmlns:z="http://xml.zope.org/namespaces/tal" z:define="local x str:hello brave new world">
<span z:insert="text local:x">hello brave new world</span>
<span z:define="local x as str:goodbye cruel world">
<span z:define="local x str:goodbye cruel world">
<span z:insert="text local:x">goodbye cruel world</span>
</span>
<span z:insert="text local:x">hello brave new world</span>
......
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" xmlns:z="http://xml.zope.org/namespaces/tal" m:define-macro="body" z:define="global count as python:0">
<body xmlns:m="http://xml.zope.org/namespaces/metal" xmlns:z="http://xml.zope.org/namespaces/tal" m:define-macro="body" z:define="global count python:0">
<ul m:define-macro="whoops" z:insert="for item in python:range(count)"/>
<ul m:define-macro="whoops">
</ul>
<span z:define="global count python:2; global message str:hello world"/>
<ul m:use-macro="whoops" z:insert="for item in python:range(count)">
<li>0 hello world</li>
<li>1 hello world</li>
<ul m:use-macro="whoops">
<li z:repeat="item python:range(count)">
0
hello world
</li><li z:repeat="item python:range(count)">
1
hello world
</li>
</ul>
<span z:define="global message as str:goodbye cruel world"/>
<span z:define="global message str:goodbye cruel world"/>
<ul m:use-macro="whoops" z:insert="for item in python:range(count)">
<li>0 goodbye cruel world</li>
<li>1 goodbye cruel world</li>
<ul m:use-macro="whoops">
<li z:repeat="item python:range(count)">
0
goodbye cruel world
</li><li z:repeat="item python:range(count)">
1
goodbye cruel world
</li>
</ul>
<p m:define-slot="whoops">define-slot</p>
......
......@@ -3,28 +3,29 @@
<head>dadada</head>
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo as python:1">
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo python:1">
<h1 z:insert="str:This Is The Replaced Title">Title</h1><span
z:omit="">This stuff is omitted</span>
<h1 z:insert="str:This Is The Replaced Title">Title</h1>
<!-- examples adapted from TemplateAttributeLanguageSyntax -->
<span z:insert="str:here/id"/>
<p z:define="x as str:template/title; global five as python:2+3" z:insert="text var:x"/>
<p z:define="x str:template/title; global five python:2+3" z:insert="text var:x"/>
<p z:replace="for car in python:['honda', 'subaru', 'acura']">
<p z:repeat="car python:['honda', 'subaru', 'acura']">
<span z:replace="var:car"/>
</p>
<!-- more examples -->
<ul z:insert="for car in python:['honda', 'subaru', 'acura']">
<ul>
<span z:repeat="car python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">Car Name</li>
</span>
</ul>
<a href="foo" z:attributes="href = python:'http://python.org' ">python</a>
<a href="foo" z:attributes="href python:'http://python.org' ">python</a>
</body>
......
<?xml version="1.0" ?>
<p xmlns:z="http://xml.zope.org/namespaces/tal">
<span z:define="local x as str:hello brave new world">
<span z:define="local x str:hello brave new world">
<span z:insert="text local:x">outer variable x, first appearance</span>
<span z:define="local x as str:goodbye cruel world">
<span z:define="local x str:goodbye cruel world">
<span z:insert="text local:x">inner variable x</span>
</span>
<span z:insert="text local:x">outer variable x, second appearance</span>
......
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" xmlns:z="http://xml.zope.org/namespaces/tal" m:define-macro="body" z:define="global count as python:0">
<body xmlns:m="http://xml.zope.org/namespaces/metal" xmlns:z="http://xml.zope.org/namespaces/tal" m:define-macro="body" z:define="global count python:0">
<ul m:define-macro="whoops" z:insert="for item in python:range(count)">
<li><span z:replace="item">1</span> <span z:replace="global:message"/></li>
<ul m:define-macro="whoops">
<li z:repeat="item python:range(count)">
<span z:replace="item">1</span>
<span z:replace="global:message"/>
</li>
</ul>
<span z:define="global count as python:2; global message as str:hello world" z:condition="python:0"/>
<span z:define="global count python:2; global message str:hello world"/>
<p m:use-macro="whoops">use-macro</p>
<span z:define="global message as str:goodbye cruel world"/>
<span z:define="global message str:goodbye cruel world"/>
<p m:use-macro="whoops">use-macro</p>
......
......@@ -3,7 +3,7 @@
<head>dadada</head>
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo as python:1">
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo python:1">
<h1 z:insert="str:This Is The Replaced Title">This Is The Replaced Title</h1>
......@@ -11,27 +11,29 @@
<span z:insert="str:here/id">here/id</span>
<p z:define="x as str:template/title; global five as python:2+3" z:insert="text var:x">template/title</p>
<p z:define="x str:template/title; global five python:2+3" z:insert="text var:x">template/title</p>
<p z:replace="for car in python:['honda', 'subaru', 'acura']">
<p z:repeat="car python:['honda', 'subaru', 'acura']">
honda
</p><p z:replace="for car in python:['honda', 'subaru', 'acura']">
</p><p z:repeat="car python:['honda', 'subaru', 'acura']">
subaru
</p><p z:replace="for car in python:['honda', 'subaru', 'acura']">
</p><p z:repeat="car python:['honda', 'subaru', 'acura']">
acura
</p>
<!-- more examples -->
<ul z:insert="for car in python:['honda', 'subaru', 'acura']">
<ul>
<span z:repeat="car python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">honda</li>
</span><span z:repeat="car python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">subaru</li>
</span><span z:repeat="car python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">acura</li>
</span>
</ul>
<a href="http://python.org" z:attributes="href = python:'http://python.org' ">python</a>
<a href="http://python.org" z:attributes="href python:'http://python.org' ">python</a>
</body>
......
<?xml version="1.0" ?>
<p>
<span xmlns:z="http://xml.zope.org/namespaces/tal" z:define="local x as str:hello brave new world">
<span xmlns:z="http://xml.zope.org/namespaces/tal" z:define="local x str:hello brave new world">
<span z:insert="text local:x">hello brave new world</span>
<span z:define="local x as str:goodbye cruel world">
<span z:define="local x str:goodbye cruel world">
<span z:insert="text local:x">goodbye cruel world</span>
</span>
<span z:insert="text local:x">hello brave new world</span>
......
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" xmlns:z="http://xml.zope.org/namespaces/tal" m:define-macro="body" z:define="global count as python:0">
<body xmlns:m="http://xml.zope.org/namespaces/metal" xmlns:z="http://xml.zope.org/namespaces/tal" m:define-macro="body" z:define="global count python:0">
<ul m:define-macro="whoops" z:insert="for item in python:range(count)"/>
<ul m:define-macro="whoops">
</ul>
<span z:define="global count python:2; global message str:hello world"/>
<ul m:use-macro="whoops" z:insert="for item in python:range(count)">
<li>0 hello world</li>
<li>1 hello world</li>
<ul m:use-macro="whoops">
<li z:repeat="item python:range(count)">
0
hello world
</li><li z:repeat="item python:range(count)">
1
hello world
</li>
</ul>
<span z:define="global message as str:goodbye cruel world"/>
<span z:define="global message str:goodbye cruel world"/>
<ul m:use-macro="whoops" z:insert="for item in python:range(count)">
<li>0 goodbye cruel world</li>
<li>1 goodbye cruel world</li>
<ul m:use-macro="whoops">
<li z:repeat="item python:range(count)">
0
goodbye cruel world
</li><li z:repeat="item python:range(count)">
1
goodbye cruel world
</li>
</ul>
<p m:define-slot="whoops">define-slot</p>
......
......@@ -3,28 +3,29 @@
<head>dadada</head>
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo as python:1">
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo python:1">
<h1 z:insert="str:This Is The Replaced Title">Title</h1><span
z:omit="">This stuff is omitted</span>
<h1 z:insert="str:This Is The Replaced Title">Title</h1>
<!-- examples adapted from TemplateAttributeLanguageSyntax -->
<span z:insert="str:here/id"/>
<p z:define="x as str:template/title; global five as python:2+3" z:insert="text var:x"/>
<p z:define="x str:template/title; global five python:2+3" z:insert="text var:x"/>
<p z:replace="for car in python:['honda', 'subaru', 'acura']">
<p z:repeat="car python:['honda', 'subaru', 'acura']">
<span z:replace="var:car"/>
</p>
<!-- more examples -->
<ul z:insert="for car in python:['honda', 'subaru', 'acura']">
<ul>
<span z:repeat="car python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">Car Name</li>
</span>
</ul>
<a href="foo" z:attributes="href = python:'http://python.org' ">python</a>
<a href="foo" z:attributes="href python:'http://python.org' ">python</a>
</body>
......
<?xml version="1.0" ?>
<p xmlns:z="http://xml.zope.org/namespaces/tal">
<span z:define="local x as str:hello brave new world">
<span z:define="local x str:hello brave new world">
<span z:insert="text local:x">outer variable x, first appearance</span>
<span z:define="local x as str:goodbye cruel world">
<span z:define="local x str:goodbye cruel world">
<span z:insert="text local:x">inner variable x</span>
</span>
<span z:insert="text local:x">outer variable x, second appearance</span>
......
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" xmlns:z="http://xml.zope.org/namespaces/tal" m:define-macro="body" z:define="global count as python:0">
<body xmlns:m="http://xml.zope.org/namespaces/metal" xmlns:z="http://xml.zope.org/namespaces/tal" m:define-macro="body" z:define="global count python:0">
<ul m:define-macro="whoops" z:insert="for item in python:range(count)">
<li><span z:replace="item">1</span> <span z:replace="global:message"/></li>
<ul m:define-macro="whoops">
<li z:repeat="item python:range(count)">
<span z:replace="item">1</span>
<span z:replace="global:message"/>
</li>
</ul>
<span z:define="global count as python:2; global message as str:hello world" z:condition="python:0"/>
<span z:define="global count python:2; global message str:hello world"/>
<p m:use-macro="whoops">use-macro</p>
<span z:define="global message as str:goodbye cruel world"/>
<span z:define="global message str:goodbye cruel world"/>
<p m:use-macro="whoops">use-macro</p>
......
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