1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/spec/spectest8.xml Wed Oct 10 22:58:48 2012 +0100
1.3 @@ -0,0 +1,54 @@
1.4 +<and>
1.5 + <expr>
1.6 + <define name="factorial" args="x">
1.7 + <if>
1.8 + <lt><x/>2</lt>
1.9 + <x/>
1.10 + <multiply>
1.11 + <x/>
1.12 + <factorial><subtract><x/>1</subtract></factorial>
1.13 + </multiply>
1.14 + </if>
1.15 + </define>
1.16 + <if>
1.17 + <eq>
1.18 + <factorial>7</factorial>
1.19 + 5040
1.20 + </eq>
1.21 + <print newline="true">PASS</print>
1.22 + <expr>
1.23 + <print newline="true">FAIL</print>
1.24 + <false/>
1.25 + </expr>
1.26 + </if>
1.27 + </expr>
1.28 + <expr>
1.29 + <define name="factorial" args="x">
1.30 + <define name="iterator" args="product counter max">
1.31 + <if>
1.32 + <gt><counter/><max/></gt>
1.33 + <product/>
1.34 + <iterator>
1.35 + <multiply><counter/><product/></multiply>
1.36 + <add><counter/>1</add>
1.37 + <max/>
1.38 + </iterator>
1.39 + </if>
1.40 + </define>
1.41 +
1.42 + <iterator>1 1 <x/></iterator>
1.43 + </define>
1.44 +
1.45 + <if>
1.46 + <eq>
1.47 + <factorial>7</factorial>
1.48 + 5040
1.49 + </eq>
1.50 + <print newline="true">PASS</print>
1.51 + <expr>
1.52 + <print newline="true">FAIL</print>
1.53 + <false/>
1.54 + </expr>
1.55 + </if>
1.56 + </expr>
1.57 +</and>