2 # Copyright (C) 2001-2007, Parrot Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test tests => 23;
13 t/op/basic.t - Basic Ops
21 Tests basic string and branching operations.
25 # It would be very embarrassing if these didnt work...
26 pasm_output_is( <<'CODE', '', "noop, end" );
31 pasm_output_is( <<'CODE', '1', "print 1" );
36 pasm_output_is( <<'CODE', 'Parrot flies', "print string" );
41 pasm_output_is( <<'CODE', 'Parrot flies', "print double-quoted string" );
46 pasm_output_is( <<'CODE', "Parrot\tflies", "print double-quoted string, tabs" );
51 pasm_output_is( <<'CODE', q('Parrot' flies), "print double-quoted string, nested single" );
52 print "'Parrot' flies"
56 pasm_output_is( <<'CODE', q("Parrot" flies), "print single-quoted string, nested double" );
57 print '"Parrot" flies'
61 pasm_output_is( <<'CODE', q(Parrot flies), "print string with embedded hex escape" );
62 print "Parrot\x20flies"
66 pasm_output_is( <<'CODE', q(Parrot flies), "escaped non-special" );
71 pasm_output_is( <<'CODE', <<OUTPUT, "print string with embedded newline" );
72 print "Parrot flies\n"
78 pasm_output_is( <<'CODE', '42', "branch_ic" );
87 pasm_output_is( <<'CODE', '42', "branch_ic (backward)" );
100 pasm_output_is( <<'CODE', <<'OUTPUT', "local_branch_c_i" );
103 new P0, 'ResizableIntegerArray'
105 local_branch P0, LAB1
110 LAB1: print "lab 1\n"
118 pasm_output_is( <<'CODE', <<'OUTPUT', "set_addr" );
121 print "Jump failed\n"
124 FOO: print "Jump succeeded\n"
130 pasm_output_is( <<'CODE', <<'OUTPUT', "multiple labels" );
142 pasm_output_is( <<'CODE', 32, "Predeclared opcodes" );
148 pir_output_is( <<'CODE', <<'OUTPUT', "pir syntax with marker - is" );
151 .const string OK = "ok\n"
160 pir_output_isnt( <<'CODE', <<'OUTPUT', "pir syntax with marker - isnt" );
163 .const string OK = "ok\n"
172 pir_output_like( <<'CODE', <<'OUTPUT', "pir syntax with marker - like" );
175 .const string OK = "ok\n"
184 pir_output_is( <<'CODE', <<'OUTPUT', "pir syntax with function - is" );
186 .const string OK = "ok\n"
195 pir_output_isnt( <<'CODE', <<'OUTPUT', "pir syntax with function - isnt" );
197 .const string OK = "ok\n"
206 pir_output_like( <<'CODE', <<'OUTPUT', "pir syntax with function - like" );
208 .const string OK = "ok 1\n"
223 #.namespace'; # no \n at end of file
225 pir_error_output_like( $CODE, <<'OUTPUT', "end of line handling" );
231 # cperl-indent-level: 4
234 # vim: expandtab shiftwidth=4: