expand alias
[dbsrgits/SQL-Abstract.git] / t / 09refkind.t
CommitLineData
4f30591b 1use strict;
2use warnings;
3use Test::More;
4use SQL::Abstract;
5
4f30591b 6my $obj = bless {}, "Foo::Bar";
7
8is(SQL::Abstract->_refkind(undef), 'UNDEF', 'UNDEF');
9
10is(SQL::Abstract->_refkind({}), 'HASHREF', 'HASHREF');
11is(SQL::Abstract->_refkind([]), 'ARRAYREF', 'ARRAYREF');
12
13is(SQL::Abstract->_refkind(\{}), 'HASHREFREF', 'HASHREFREF');
14is(SQL::Abstract->_refkind(\[]), 'ARRAYREFREF', 'ARRAYREFREF');
15
16is(SQL::Abstract->_refkind(\\{}), 'HASHREFREFREF', 'HASHREFREFREF');
17is(SQL::Abstract->_refkind(\\[]), 'ARRAYREFREFREF', 'ARRAYREFREFREF');
18
19is(SQL::Abstract->_refkind("foo"), 'SCALAR', 'SCALAR');
20is(SQL::Abstract->_refkind(\"foo"), 'SCALARREF', 'SCALARREF');
21is(SQL::Abstract->_refkind(\\"foo"), 'SCALARREFREF', 'SCALARREFREF');
22
23# objects are treated like scalars
24is(SQL::Abstract->_refkind($obj), 'SCALAR', 'SCALAR');
25is(SQL::Abstract->_refkind(\$obj), 'SCALARREF', 'SCALARREF');
26is(SQL::Abstract->_refkind(\\$obj), 'SCALARREFREF', 'SCALARREFREF');
27
10e6c946 28done_testing;