refs.t revision 1.1.1.1
1#!perl 2 3use strict; 4use warnings; 5 6use Test::More tests => 9; 7 8use Tie::Scalar; 9 10use_ok('XS::APItest'); 11 12my $a; 13my $sr = \$a; 14my $ar = []; 15my $hr = {}; 16my $cr = sub{}; 17 18is XS::APItest::take_svref($sr), $sr; 19is XS::APItest::take_avref($ar), $ar; 20is XS::APItest::take_hvref($hr), $hr; 21is XS::APItest::take_cvref($cr), $cr; 22 23my $obj = tie my $ref, 'Tie::StdScalar'; 24${$obj} = $sr; 25is XS::APItest::take_svref($sr), $sr; 26 27${$obj} = $ar; 28is XS::APItest::take_avref($ar), $ar; 29 30${$obj} = $hr; 31is XS::APItest::take_hvref($hr), $hr; 32 33${$obj} = $cr; 34is XS::APItest::take_cvref($cr), $cr; 35