X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02where.t;h=b93b79f50dece579ff1509b9d6cd50df1235cf0a;hb=25823711a9e82eba7d569ec08a5cc0c40658def2;hp=f71a411e94e34cb2d9084109e4a8abac445be0ba;hpb=4b7b60267d9cb89e13d1da14e1ae3ec4b6e7395a;p=scpubgit%2FQ-Branch.git diff --git a/t/02where.t b/t/02where.t index f71a411..b93b79f 100644 --- a/t/02where.t +++ b/t/02where.t @@ -4,15 +4,15 @@ use strict; use warnings; use Test::More; use Test::Exception; - -use SQL::Abstract::Test qw/is_same_sql_bind/; -plan tests => 16; +use SQL::Abstract::Test import => ['is_same_sql_bind']; use SQL::Abstract; # Make sure to test the examples, since having them break is somewhat # embarrassing. :-( +my $not_stringifiable = bless {}, 'SQLA::NotStringifiable'; + my @handle_tests = ( { where => { @@ -182,9 +182,17 @@ my @handle_tests = ( bind => [ 1 ], }, + { + where => { foo => $not_stringifiable, }, + stmt => " WHERE ( foo = ? )", + bind => [ $not_stringifiable ], + }, ); + +plan tests => scalar(@handle_tests) + 1; + for my $case (@handle_tests) { my $sql = SQL::Abstract->new; my($stmt, @bind) = $sql->where($case->{where}, $case->{order}); @@ -194,4 +202,4 @@ for my $case (@handle_tests) { dies_ok { my $sql = SQL::Abstract->new; $sql->where({ foo => { '>=' => [] }},); -} +};