This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix test count in ext/XS-APItest/t/refs.t
[perl5.git] / ext / XS-APItest / t / refs.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 9;
7
8 use Tie::Scalar;
9
10 use_ok('XS::APItest');
11
12 my $a;
13 my $sr = \$a;
14 my $ar = [];
15 my $hr = {};
16 my $cr = sub{};
17
18 is XS::APItest::take_svref($sr), $sr;
19 is XS::APItest::take_avref($ar), $ar;
20 is XS::APItest::take_hvref($hr), $hr;
21 is XS::APItest::take_cvref($cr), $cr;
22
23 my $obj = tie my $ref, 'Tie::StdScalar';
24 ${$obj} = $sr;
25 is XS::APItest::take_svref($sr), $sr;
26
27 ${$obj} = $ar;
28 is XS::APItest::take_avref($ar), $ar;
29
30 ${$obj} = $hr;
31 is XS::APItest::take_hvref($hr), $hr;
32
33 ${$obj} = $cr;
34 is XS::APItest::take_cvref($cr), $cr;