2 # Copyright (C) 2005-2006, Parrot Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test tests => 3;
14 t/examples/pasm.t - Test examples in F<examples/pasm>
18 % prove t/examples/pasm.t
22 Test the examples in F<examples/pasm>.
26 Put expected output into the example files.
34 # Set up expected output for examples
37 'hello.pasm' => << 'END_EXPECTED',
41 # 'xml_parser.pasm' => << 'END_EXPECTED',
42 #Start xml version=1.0
44 #Start inner foo=bar narf=poit
57 skip( 'GMP is not available', 1 ) unless $PConfig{gmp};
59 $expected{'fact.pasm'} = << 'END_EXPECTED'
70 fact of 10 is: 3628800
71 fact of 11 is: 39916800
72 fact of 12 is: 479001600
73 fact of 13 is: 6227020800
74 fact of 14 is: 87178291200
75 fact of 15 is: 1307674368000
76 fact of 16 is: 20922789888000
77 fact of 17 is: 355687428096000
78 fact of 18 is: 6402373705728000
79 fact of 19 is: 121645100408832000
80 fact of 20 is: 2432902008176640000
81 fact of 21 is: 51090942171709440000
82 fact of 22 is: 1124000727777607680000
83 fact of 23 is: 25852016738884976640000
84 fact of 24 is: 620448401733239439360000
85 fact of 25 is: 15511210043330985984000000
86 fact of 26 is: 403291461126605635584000000
87 fact of 27 is: 10888869450418352160768000000
88 fact of 28 is: 304888344611713860501504000000
89 fact of 29 is: 8841761993739701954543616000000
90 fact of 30 is: 265252859812191058636308480000000
94 while ( my ( $example, $expected ) = each %expected ) {
95 example_output_is( "examples/pasm/$example", $expected );
100 local $TODO = 'nanoforth2.pasm not testable yet';
101 fail('nanoforth2.pasm');
106 # cperl-indent-level: 4
109 # vim: expandtab shiftwidth=4: