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