* t/oo/composition.t, t/oo/mro-c3.t, t/op/calling.t:
[parrot.git] / t / pmc / slice.t
blob49995c2733cf97b00e2c6daacaed654c50dc0a6e
1 #!perl
2 # Copyright (C) 2006-2007, The Perl Foundation.
3 # $Id$
5 use strict;
6 use warnings;
7 use lib qw( . lib ../lib ../../lib );
8 use Test::More;
9 use Parrot::Test tests => 2;
11 =head1 NAME
13 t/pmc/slice.t - test Slice PMC
16 =head1 SYNOPSIS
18     % prove t/pmc/slice.t
20 =head1 DESCRIPTION
22 Tests the Slice PMC.
24 =cut
26 pir_output_is( <<'CODE', <<'OUT', 'new' );
27 .sub 'test' :main
28     new P0, 'Slice'
29     print "ok 1\n"
30 .end
31 CODE
32 ok 1
33 OUT
35 pir_output_is( <<'CODE', <<'OUT', 'bug with slice bits', todo => 'parser' );
36 # the VT_CONSTP status gets destroyed, if this constant is
37 # used somewhere else as slice index
38 .const int vx = 3
40 .sub main :main
41     .local pmc b, bj
42     b = new 'FixedPMCArray'
43     b = 4
44     bj = new 'FixedFloatArray'
45     bj = 5
46     b[3] = bj
47     $N0 = b[3 .. vx]
48     bj = b[3]
49     $N1 = bj[vx]
50     $N1 += 1.0
51     bj[vx] = $N1
52     print $N1
53     print "\n"
54 .end
55 CODE
56 1.000000
57 OUT
59 # Local Variables:
60 #   mode: cperl
61 #   cperl-indent-level: 4
62 #   fill-column: 100
63 # End:
64 # vim: expandtab shiftwidth=4: