Commit 23700b46 authored by Guido van Rossum's avatar Guido van Rossum

test cases for macro expansion

parent b788e259
<?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">
<ul m:define-macro="whoops" z:insert="for item in python:range(count)"/>
<ul m:use-macro="whoops" z:insert="for item in python:range(count)">
<li>0 hello world</li>
<li>1 hello world</li>
</ul>
<span z:define="global message as 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>
<p m:define-slot="whoops">define-slot</p>
<p m:use-slot="whoops">use-slot</p>
</body>
</html>
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" m:define-macro="body">
<h1>This is the body of test5</h1>
</body>
</html>
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" m:use-macro="body">
<h1>This is the body of test5</h1>
</body>
</html>
<?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">
<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>
<span z:define="global count as python:2; global message as str:hello world" z:condition="python:0"/>
<p m:use-macro="whoops">use-macro</p>
<span z:define="global message as str:goodbye cruel world"/>
<p m:use-macro="whoops">use-macro</p>
<p m:define-slot="whoops">define-slot</p>
<p m:use-slot="whoops">use-slot</p>
</body>
</html>
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" m:define-macro="body">
<h1>This is the body of test5</h1>
</body>
</html>
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal"
m:use-macro="test/test5.xml/body">
dummy body in test6
</body>
</html>
<?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">
<ul m:define-macro="whoops" z:insert="for item in python:range(count)"/>
<ul m:use-macro="whoops" z:insert="for item in python:range(count)">
<li>0 hello world</li>
<li>1 hello world</li>
</ul>
<span z:define="global message as 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>
<p m:define-slot="whoops">define-slot</p>
<p m:use-slot="whoops">use-slot</p>
</body>
</html>
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" m:define-macro="body">
<h1>This is the body of test5</h1>
</body>
</html>
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" m:use-macro="body">
<h1>This is the body of test5</h1>
</body>
</html>
<?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">
<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>
<span z:define="global count as python:2; global message as str:hello world" z:condition="python:0"/>
<p m:use-macro="whoops">use-macro</p>
<span z:define="global message as str:goodbye cruel world"/>
<p m:use-macro="whoops">use-macro</p>
<p m:define-slot="whoops">define-slot</p>
<p m:use-slot="whoops">use-slot</p>
</body>
</html>
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal" m:define-macro="body">
<h1>This is the body of test5</h1>
</body>
</html>
<?xml version="1.0" ?>
<html>
<body xmlns:m="http://xml.zope.org/namespaces/metal"
m:use-macro="test/test5.xml/body">
dummy body in test6
</body>
</html>
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