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