import source from 1.3.40
[external/swig.git] / Examples / test-suite / perl5 / li_cdata_carrays_runme.pl
1 use strict;
2 use warnings;
3 use Test::More tests => 4;
4 BEGIN { use_ok('li_cdata_carrays') }
5 require_ok('li_cdata_carrays');
6
7 my $ia = li_cdata_carrays::intArray->new(5);
8 for (0..4) {
9   $ia->setitem($_, $_**2);
10 }
11 ok(1, "setitems");
12 my $x = pack q{I5}, map $_**2, (0..4);
13 my $y = li_cdata_carrays::cdata_int($ia->cast, 5);
14 is($x, $y, "carrays");