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