2 # Copyright (C) 2005-2006, The Perl Foundation.
7 use lib qw(t . lib ../lib ../../lib ../../../lib);
9 use Parrot::Test tests => 3;
13 t/basic.t - testing a few basic components of TGE::Grammar and TGE::Tree
17 $ prove t/compilers/tge/basic.t
21 pir_output_is( <<'CODE', <<'OUT', 'build up a basic rule in a grammar' );
24 load_bytecode 'TGE.pbc'
27 AG = new 'TGE::Grammar'
28 AG.add_rule('Leaf', 'min', '.', '.return(1)')
30 $P1 = getattribute AG, 'rules'
33 $P2 = getattribute rule_obj, 'type'
36 $P3 = getattribute rule_obj, 'name'
39 $P4 = getattribute rule_obj, 'parent'
51 pir_output_is( <<'CODE', <<'OUT', 'agid hash' );
53 load_bytecode 'compilers/tge/TGE/Tree.pir'
55 tree = new 'TGE::Tree'
59 id = tree.'_lookup_id'($P0)
63 id = tree.'_lookup_id'($P1)
66 id = tree.'_lookup_id'($P0)
70 id = tree.'_lookup_id'($P2)
73 id = tree.'_lookup_id'($P0)
76 id = tree.'_lookup_id'($P1)
79 id = tree.'_lookup_id'($P2)
95 pir_output_is( <<'CODE', <<'OUT', '"Malformed string" in r11890 under Linux i386' );
98 load_bytecode "TGE.pbc"
107 # cperl-indent-level: 4
110 # vim: expandtab shiftwidth=4: