swig/Examples/test-suite/perl5/li_cdata_carrays_runme.pl
Robert Stone 8b713d759d several testcases for perl
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10403 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-04-30 21:02:46 +00:00

14 lines
342 B
Perl

use strict;
use warnings;
use Test::More tests => 4;
BEGIN { use_ok('li_cdata_carrays') }
require_ok('li_cdata_carrays');
my $ia = li_cdata_carrays::intArray->new(5);
for (0..4) {
$ia->setitem($_, $_**2);
}
ok(1, "setitems");
my $x = pack q{I5}, map $_**2, (0..4);
my $y = li_cdata_carrays::cdata_int($ia->cast, 5);
is($x, $y, "carrays");