1. Shlomi Fish
  2. Perl-XS-Guide

Source

Perl-XS-Guide / perl5 / ext-embed-internals / docbook / examples / 0008-assign-to-array / XSTest / t / 02-feature.t

use Test::More tests => 5;

BEGIN {
use_ok( 'XSTest' );
}

my $obj = XSTest->new(1);
ok( $obj->increment );
ok( $obj->{value} == 2);

$obj = XSTest->new(value => 3);
ok( $obj->{value} == 3 );
ok( $obj->increment == 4 );