Merged changes from the '1.50_RC-extraparens' branch.
[scpubgit/Q-Branch.git] / t / 02where.t
index f71a411..b93b79f 100644 (file)
@@ -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 => { '>=' => [] }},);
-}
+};