use Test::More;
use Test::Warn;
use Test::Exception;
+use Data::Dumper;
use SQL::Abstract::Test import => ['is_same_sql_bind'];
stmt_q => 'SELECT * FROM `test` WHERE ( `Y` = ( MAX( LENGTH( MIN ? ) ) ) )',
bind => [[Y => 'x']],
},
+ {
+ func => 'select',
+ args => ['test', '*', { a => { -in => [] }, b => { -not_in => [] }, c => { -in => 42 } }],
+ stmt => 'SELECT * FROM test WHERE ( 0=1 AND 1=1 AND c IN ( ? ))',
+ stmt_q => 'SELECT * FROM `test` WHERE ( 0=1 AND 1=1 AND `c` IN ( ? ))',
+ bind => [ 42 ],
+ },
);
-
-plan tests => scalar(grep { !$_->{warning_like} } @tests) * 2
- + scalar(grep { $_->{warning_like} } @tests) * 4;
-
for my $t (@tests) {
local $"=', ';
);
}
else {
- $cref->();
+ unless (eval { $cref->(); 1 }) {
+ die "Unexpected exception thrown for structure:\n"
+ .Dumper($t)."Exception was: $@";
+ }
}
is_same_sql_bind(
$stmt,
}
}
}
+
+done_testing;