test/spec/spectest8.xml
author ali <ali@juiblex.co.uk>
Wed Oct 10 22:58:48 2012 +0100 (2012-10-10)
changeset 1 fe592b4168f3
permissions -rw-r--r--
Added tag 1.0 for changeset bc8c9a11cbfc
     1 <and>
     2   <expr>
     3     <define name="factorial" args="x">
     4       <if>
     5 	<lt><x/>2</lt>
     6 	<x/>
     7 	<multiply>
     8 	  <x/>
     9 	  <factorial><subtract><x/>1</subtract></factorial>
    10 	</multiply>
    11       </if>
    12     </define>
    13     <if>
    14       <eq>
    15 	<factorial>7</factorial>
    16 	5040
    17       </eq>
    18       <print newline="true">PASS</print>
    19       <expr>
    20 	<print newline="true">FAIL</print>
    21 	<false/>
    22       </expr>
    23     </if>
    24   </expr>
    25   <expr>
    26     <define name="factorial" args="x">
    27       <define name="iterator" args="product counter max">
    28 	<if>
    29 	  <gt><counter/><max/></gt>
    30 	  <product/>
    31 	  <iterator>
    32 	    <multiply><counter/><product/></multiply>
    33 	    <add><counter/>1</add>
    34 	    <max/>
    35 	  </iterator>
    36 	</if>
    37       </define>
    38 
    39       <iterator>1 1 <x/></iterator>
    40     </define>
    41 
    42     <if>
    43       <eq>
    44 	<factorial>7</factorial>
    45 	5040
    46       </eq>
    47       <print newline="true">PASS</print>
    48       <expr>
    49 	<print newline="true">FAIL</print>
    50 	<false/>
    51       </expr>
    52     </if>
    53   </expr>
    54 </and>