2 # Copyright (C) 2001-2007, The Perl Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test tests => 13;
13 t/pmc/fixedbooleanarray.t - FixedBooleanArray PMC
17 % prove t/pmc/FixedBooleanArray.t
21 Tests C<FixedBooleanArray> PMC. Checks size, sets various elements, including
22 out-of-bounds test. Checks INT and PMC keys.
26 my $fp_equality_macro = pasm_fp_equality_macro();
28 pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
29 new P0, 'FixedBooleanArray'
48 pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and getting an exception)" );
49 new P0, 'FixedBooleanArray'
54 print "Should have gotten an exception\n"
59 /FixedBooleanArray: Can't resize!
63 #VIM's syntax highlighter needs this line
65 pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
66 new P0, 'FixedBooleanArray'
94 pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
95 new P0, 'FixedBooleanArray'
123 pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
124 new P0, 'FixedBooleanArray'
131 /FixedBooleanArray: index out of bounds!
135 pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
136 new P0, 'FixedBooleanArray'
142 /FixedBooleanArray: index out of bounds!
146 pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
147 @{[ $fp_equality_macro ]}
148 new P0, 'FixedBooleanArray'
183 pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
184 @{[ $fp_equality_macro ]}
185 new P0, 'FixedBooleanArray'
229 pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
233 pmc1 = new 'FixedBooleanArray'
235 does bool1, pmc1, "scalar"
238 does bool1, pmc1, "array"
241 does bool1, pmc1, "no_interface"
252 pasm_output_is( << 'CODE', << 'OUTPUT', "Truth" );
253 new P0, 'FixedBooleanArray'
272 pasm_output_is( << 'CODE', << 'OUTPUT', "PMC keys & values" );
273 new P0, 'FixedBooleanArray'
288 pir_output_is( <<'CODE', <<'OUTPUT', "freeze/thaw" );
294 fba = new 'FixedBooleanArray'
316 pir_output_is( <<'CODE', <<'OUTPUT', "clone" );
318 .local pmc fba1, fba2
322 fba1 = new 'FixedBooleanArray'
347 # cperl-indent-level: 4
350 # vim: expandtab shiftwidth=4: