From: Peter Rabbitson Date: Sun, 8 Mar 2009 20:50:06 +0000 (+0000) Subject: Failing tests by debolaz X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=73a67e2c17324ac4a4524e6c2d0f760c63080045;p=scpubgit%2FQ-Branch.git Failing tests by debolaz --- diff --git a/t/02where.t b/t/02where.t index b93b79f..87ce1c2 100644 --- a/t/02where.t +++ b/t/02where.t @@ -27,6 +27,15 @@ my @handle_tests = ( }, { + where => [ + status => 'completed', + user => 'nwiger', + ], + stmt => " WHERE ( status = ? OR user = ? )", + bind => [qw/completed nwiger/], + }, + + { where => { user => 'nwiger', status => 'completed' @@ -188,15 +197,30 @@ my @handle_tests = ( bind => [ $not_stringifiable ], }, + { + where => \[ 'foo ?','bar' ], + stmt => " WHERE (foo = ?)", + bind => [ "bar" ], + }, + + { + where => [ \[ 'foo ?','bar' ] ], + stmt => " WHERE (foo = ?)", + bind => [ "bar" ], + }, + ); -plan tests => scalar(@handle_tests) + 1; +plan tests => ( @handle_tests * 2 ) + 1; for my $case (@handle_tests) { my $sql = SQL::Abstract->new; - my($stmt, @bind) = $sql->where($case->{where}, $case->{order}); - is_same_sql_bind($stmt, \@bind, $case->{stmt}, $case->{bind}) + my($stmt, @bind); + lives_ok (sub { + ($stmt, @bind) = $sql->where($case->{where}, $case->{order}); + is_same_sql_bind($stmt, \@bind, $case->{stmt}, $case->{bind}); + }); } dies_ok {