Skip to content

Commit

Permalink
[t] Improve coverage of FPA
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@41004 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
NotFound authored and NotFound committed Sep 5, 2009
1 parent ccf0d6d commit 0688956
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion t/pmc/fixedpmcarray.t
Expand Up @@ -6,7 +6,7 @@ use strict;
use warnings;
use lib qw(lib . ../lib ../../lib);

use Parrot::Test tests => 22;
use Parrot::Test tests => 25;
use Test::More;

=head1 NAME
Expand Down Expand Up @@ -44,6 +44,53 @@ ok 1
ok 2
OUTPUT

pir_output_is( <<'CODE', <<'OUTPUT', "Assign from other FPA");
.sub main
.local pmc arr1, arr2
.local int n
arr1 = new ['FixedPMCArray']
arr1 = 32
arr2 = new ['FixedPMCArray']
arr2 = 15
assign arr1, arr2
n = arr1
say n
.end
CODE
15
OUTPUT

pir_output_is( <<'CODE', <<'OUTPUT', "Assign to self");
.sub main
.local pmc arr
arr = new ['FixedPMCArray']
assign arr, arr
say 'Done'
.end
CODE
Done
OUTPUT

pir_output_is( <<'CODE', <<'OUTPUT', "Assign from non-array");
.sub main
.local pmc arr, other
.local int n
arr = new ['FixedPMCArray']
other = new ['Integer']
push_eh catch
say 'Assign'
assign arr, other
say 'Never here!'
goto done
catch:
say 'Catched'
done:
.end
CODE
Assign
Catched
OUTPUT

pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and getting an exception)" );
new P0, ['FixedPMCArray']
Expand Down

0 comments on commit 0688956

Please sign in to comment.