# $suffix = 'REF' x (length of ref chain, i. e. \\[] is REFREFREF)
while (1) {
+ # blessed references are considered like scalars
+ last if blessed $data;
$suffix .= 'REF';
+ $ref = ref $data;
- # blessed references that can stringify are considered like scalars
- $ref = (blessed $data && overload::Method($data, '""')) ? ''
- : ref $data;
last if $ref ne 'REF';
$data = $$data;
}
use Test::Exception;
use SQL::Abstract::Test import => ['is_same_sql_bind'];
-plan tests => 17;
+plan tests => 18;
use SQL::Abstract;
# Make sure to test the examples, since having them break is somewhat
# embarrassing. :-(
+my $not_stringifiable = SQLA::NotStringifiable->new();
+
my @handle_tests = (
{
where => {
bind => [ 'The Life, the Universe and Everything.' ],
},
+ {
+ where => { foo => $not_stringifiable, },
+ stmt => " WHERE ( foo = ? )",
+ bind => [ $not_stringifiable ],
+ },
+
);
}
1;
+
+
+#======================================================================
+package SQLA::NotStringifiable; # testing stringification of arguments
+#======================================================================
+
+use strict;
+use warnings;
+
+sub new
+{
+ bless {}, shift;
+}
+
+1;