2 # Copyright (C) 2001-2004, The Perl Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test tests => 13;
13 t/pmc/array.t - Array PMC
21 Tests C<Array> PMC. Checks size, sets various elements, including
22 out-of-bounds test. Checks INT and PMC keys.
26 my $fp_equality_macro = <<'ENDOFMACRO';
27 .macro fp_eq ( J, K, L )
36 gt N2, 0.000001, .$FPEQNOK
56 lt N2, 0.000001, .$FPNENOK
69 pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
106 pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
124 eq S0,"Buckaroo",OK_3
135 pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
153 eq S0,"Buckaroo",OK_3
164 pasm_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
172 /^Array index out of bounds!
176 pasm_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
183 /^Array index out of bounds!
187 pasm_output_is( <<'CODE', <<OUTPUT, "defined" );
233 pasm_output_is( <<'CODE', <<OUTPUT, "exists" );
271 pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
272 @{[ $fp_equality_macro ]}
320 pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
321 @{[ $fp_equality_macro ]}
327 set P0[513], "qwertyuiopasdfghjklzxcvbnm"
341 .fp_eq(N0, -9.9, OK2)
347 eq S0, "qwertyuiopasdfghjklzxcvbnm", OK3
366 pasm_output_is( <<'CODE', <<OUT, "multikeyed access I arg" );
393 pasm_output_is( <<'CODE', <<OUT, "multikeyed access P arg" );
422 pasm_output_is( <<'CODE', <<OUT, "delete" );
443 pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
449 does bool1, pmc1, "scalar"
452 does bool1, pmc1, "array"
455 does bool1, pmc1, "no_interface"
470 # cperl-indent-level: 4
473 # vim: expandtab shiftwidth=4: