Commit 78f3476f authored by Guido van Rossum's avatar Guido van Rossum

Add expected output for the test suite and a shell script that acts as

a simple regression test.
parent 747e87e4
......@@ -50,6 +50,8 @@ driver.py script to demonstrate TAL expansion
timer.py script to time various processing phases
setpath.py hack to set sys.path and import ZODB
__init__.py empty file that makes this directory a package
runtest.sh shell script to run regression tests
test/ drectory with test files and output
Author and License
------------------
......
#! /bin/bash
# Run the regression test suite
: ${TMPDIR=/tmp}
for test in test/test*.xml
do
out=` echo $test | sed 's,test/test,test/out,' `
tmp=$TMPDIR/taltest$$`basename $test`
./driver.py $test >$tmp
if cmp -s $tmp $out
then
echo $test OK
else
echo $test failed -- diff follows
diff $out $tmp
fi
rm $tmp
done
<?xml version="1.0" ?>
<html>
<head>dadada</head>
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo as python:1">
<h1 z:insert="str:This Is The Replaced Title">This Is The Replaced Title</h1>
<!-- examples adapted from TemplateAttributeLanguageSyntax -->
<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:replace="for car in python:['honda', 'subaru', 'acura']">
honda
</p><p z:replace="for car in python:['honda', 'subaru', 'acura']">
subaru
</p><p z:replace="for car in python:['honda', 'subaru', 'acura']">
acura
</p>
<!-- more examples -->
<ul z:insert="for car in python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">honda</li>
<li z:insert="var:car">subaru</li>
<li z:insert="var:car">acura</li>
</ul>
<a href="http://python.org" z:attributes="href = python:'http://python.org' ">python</a>
</body>
</html>
<?xml version="1.0" ?>
<biztalk_1>
<header plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<manifest>
<document>
<name>sample1</name>
<description>a simple invoice</description>
</document>
</manifest>
</header>
<body>
<!-- sample1.xml is an example of a simple invoice for a small restaurant supplies order -->
<Invoice>
<Header>
<InvoiceNumber>01786</InvoiceNumber>
<InvoiceDate>2000-03-17</InvoiceDate> <!-- March 17th, 2000 -->
<OrderNo>55377</OrderNo>
<OrderDate>2000-03-15</OrderDate> <!-- March 15th, 2000 -->
<CustomerPO>GJ03405</CustomerPO>
<ShipMethod>DAVE 1</ShipMethod>
<ShipDate>2000-03-17</ShipDate> <!-- March 17th, 2000 -->
<CustomerID>K5211(34)</CustomerID>
<SalesPersonCode>23</SalesPersonCode>
<TaxID>23</TaxID>
</Header>
<InvoiceTo>
<Name>SHIPWRIGHT RESTAURANTS LIMITED</Name>
<AddressLine>125 NORTH SERVICE ROAD W</AddressLine>
<AddressLine>WESTLAKE ACCESS</AddressLine>
<City>NORTH BAY</City>
<PostCode>L8B1O5</PostCode>
<State>ONTARIO</State>
<Country>CANADA</Country>
</InvoiceTo>
<ShipTo>
<Name/>
<AddressLine>ATTN: PAULINE DEGRASSI</AddressLine>
<City/>
<PostCode/>
<State/>
<Country/>
</ShipTo>
<DetailLines>
<DetailLine>
<QuantityShipped>1</QuantityShipped>
<UnitOfMeasure>CS</UnitOfMeasure>
<PartNumber>DM 5309</PartNumber>
<PartDescription>#1013 12 OZ.MUNICH STEIN</PartDescription>
<UnitPrice>37.72</UnitPrice>
<LineTotal>37.72</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>6</QuantityShipped>
<UnitOfMeasure>DZ</UnitOfMeasure>
<PartNumber>ON 6420</PartNumber>
<PartDescription>PROVINCIAL DINNER FORK</PartDescription>
<UnitPrice>17.98</UnitPrice>
<LineTotal>107.88</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>72</QuantityShipped>
<UnitOfMeasure>EA</UnitOfMeasure>
<PartNumber>JR20643</PartNumber>
<PartDescription>PLASTIC HANDLED STEAK KNIFE</PartDescription>
<UnitPrice>.81</UnitPrice>
<LineTotal>58.32</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>6</QuantityShipped>
<UnitOfMeasure>DZ</UnitOfMeasure>
<PartNumber>ON 6410</PartNumber>
<PartDescription>PROVINCIAL TEASPOONS</PartDescription>
<UnitPrice>12.16</UnitPrice>
<LineTotal>72.96</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>0</QuantityShipped>
<UnitOfMeasure>DZ</UnitOfMeasure>
<PartNumber>ON 6411</PartNumber>
<PartDescription>PROVINCIAL RD BOWL SPOON</PartDescription>
<QuantityBackOrdered>6</QuantityBackOrdered>
<UnitPrice>17.98</UnitPrice>
<LineTotal>0.00</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>1</QuantityShipped>
<UnitOfMeasure>EA</UnitOfMeasure>
<PartNumber>DO 3218</PartNumber>
<PartDescription>34 OZ DUAL DIAL SCALE AM3218</PartDescription>
<UnitPrice>70.00</UnitPrice>
<DiscountPercentage>5.0</DiscountPercentage>
<LineTotal>66.50</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>1</QuantityShipped>
<UnitOfMeasure>CS</UnitOfMeasure>
<PartNumber>DM 195</PartNumber>
<PartDescription>20 OZ.BEER PUB GLASS</PartDescription>
<UnitPrice>55.90</UnitPrice>
<LineTotal>55.90</LineTotal>
</DetailLine>
</DetailLines>
<Totals>
<SubTotal>399.28</SubTotal>
<DiscountTotal>3.50</DiscountTotal>
<FreightTotal>23.75</FreightTotal>
<GSTTotal>29.61</GSTTotal>
<ProvTaxTotal>33.84</ProvTaxTotal>
<OtherTotal>33.84</OtherTotal>
<InvoiceTotal>486.48</InvoiceTotal>
</Totals>
</Invoice>
</body>
</biztalk_1>
<?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 z:insert="text local:x">hello brave new world</span>
<span z:define="local x as 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>
</span>
</p>
<?xml version="1.0" ?>
<html>
<head>dadada</head>
<body xmlns:z="http://xml.zope.org/namespaces/tal" z:define="foo as python:1">
<h1 z:insert="str:This Is The Replaced Title">This Is The Replaced Title</h1>
<!-- examples adapted from TemplateAttributeLanguageSyntax -->
<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:replace="for car in python:['honda', 'subaru', 'acura']">
honda
</p><p z:replace="for car in python:['honda', 'subaru', 'acura']">
subaru
</p><p z:replace="for car in python:['honda', 'subaru', 'acura']">
acura
</p>
<!-- more examples -->
<ul z:insert="for car in python:['honda', 'subaru', 'acura']">
<li z:insert="var:car">honda</li>
<li z:insert="var:car">subaru</li>
<li z:insert="var:car">acura</li>
</ul>
<a href="http://python.org" z:attributes="href = python:'http://python.org' ">python</a>
</body>
</html>
<?xml version="1.0" ?>
<biztalk_1>
<header plain="guido" quote='"' apostrophe="'" both="&quot;'" lt="&lt;" gt="&gt;" amp="&amp;" foo="">
<manifest>
<document>
<name>sample1</name>
<description>a simple invoice</description>
</document>
</manifest>
</header>
<body>
<!-- sample1.xml is an example of a simple invoice for a small restaurant supplies order -->
<Invoice>
<Header>
<InvoiceNumber>01786</InvoiceNumber>
<InvoiceDate>2000-03-17</InvoiceDate> <!-- March 17th, 2000 -->
<OrderNo>55377</OrderNo>
<OrderDate>2000-03-15</OrderDate> <!-- March 15th, 2000 -->
<CustomerPO>GJ03405</CustomerPO>
<ShipMethod>DAVE 1</ShipMethod>
<ShipDate>2000-03-17</ShipDate> <!-- March 17th, 2000 -->
<CustomerID>K5211(34)</CustomerID>
<SalesPersonCode>23</SalesPersonCode>
<TaxID>23</TaxID>
</Header>
<InvoiceTo>
<Name>SHIPWRIGHT RESTAURANTS LIMITED</Name>
<AddressLine>125 NORTH SERVICE ROAD W</AddressLine>
<AddressLine>WESTLAKE ACCESS</AddressLine>
<City>NORTH BAY</City>
<PostCode>L8B1O5</PostCode>
<State>ONTARIO</State>
<Country>CANADA</Country>
</InvoiceTo>
<ShipTo>
<Name/>
<AddressLine>ATTN: PAULINE DEGRASSI</AddressLine>
<City/>
<PostCode/>
<State/>
<Country/>
</ShipTo>
<DetailLines>
<DetailLine>
<QuantityShipped>1</QuantityShipped>
<UnitOfMeasure>CS</UnitOfMeasure>
<PartNumber>DM 5309</PartNumber>
<PartDescription>#1013 12 OZ.MUNICH STEIN</PartDescription>
<UnitPrice>37.72</UnitPrice>
<LineTotal>37.72</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>6</QuantityShipped>
<UnitOfMeasure>DZ</UnitOfMeasure>
<PartNumber>ON 6420</PartNumber>
<PartDescription>PROVINCIAL DINNER FORK</PartDescription>
<UnitPrice>17.98</UnitPrice>
<LineTotal>107.88</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>72</QuantityShipped>
<UnitOfMeasure>EA</UnitOfMeasure>
<PartNumber>JR20643</PartNumber>
<PartDescription>PLASTIC HANDLED STEAK KNIFE</PartDescription>
<UnitPrice>.81</UnitPrice>
<LineTotal>58.32</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>6</QuantityShipped>
<UnitOfMeasure>DZ</UnitOfMeasure>
<PartNumber>ON 6410</PartNumber>
<PartDescription>PROVINCIAL TEASPOONS</PartDescription>
<UnitPrice>12.16</UnitPrice>
<LineTotal>72.96</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>0</QuantityShipped>
<UnitOfMeasure>DZ</UnitOfMeasure>
<PartNumber>ON 6411</PartNumber>
<PartDescription>PROVINCIAL RD BOWL SPOON</PartDescription>
<QuantityBackOrdered>6</QuantityBackOrdered>
<UnitPrice>17.98</UnitPrice>
<LineTotal>0.00</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>1</QuantityShipped>
<UnitOfMeasure>EA</UnitOfMeasure>
<PartNumber>DO 3218</PartNumber>
<PartDescription>34 OZ DUAL DIAL SCALE AM3218</PartDescription>
<UnitPrice>70.00</UnitPrice>
<DiscountPercentage>5.0</DiscountPercentage>
<LineTotal>66.50</LineTotal>
</DetailLine>
<DetailLine>
<QuantityShipped>1</QuantityShipped>
<UnitOfMeasure>CS</UnitOfMeasure>
<PartNumber>DM 195</PartNumber>
<PartDescription>20 OZ.BEER PUB GLASS</PartDescription>
<UnitPrice>55.90</UnitPrice>
<LineTotal>55.90</LineTotal>
</DetailLine>
</DetailLines>
<Totals>
<SubTotal>399.28</SubTotal>
<DiscountTotal>3.50</DiscountTotal>
<FreightTotal>23.75</FreightTotal>
<GSTTotal>29.61</GSTTotal>
<ProvTaxTotal>33.84</ProvTaxTotal>
<OtherTotal>33.84</OtherTotal>
<InvoiceTotal>486.48</InvoiceTotal>
</Totals>
</Invoice>
</body>
</biztalk_1>
<?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 z:insert="text local:x">hello brave new world</span>
<span z:define="local x as 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>
</span>
</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