From: Peter Rabbitson Date: Mon, 9 Mar 2009 01:26:52 +0000 (+0000) Subject: Fix is_* in test to return the correct test value X-Git-Tag: v1.70~217 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a828f61e5c85cb650c591fb3e4c12e8db15e845;p=dbsrgits%2FSQL-Abstract.git Fix is_* in test to return the correct test value --- diff --git a/lib/SQL/Abstract/Test.pm b/lib/SQL/Abstract/Test.pm index edda905..564a843 100644 --- a/lib/SQL/Abstract/Test.pm +++ b/lib/SQL/Abstract/Test.pm @@ -74,7 +74,7 @@ sub is_same_sql_bind { my $same_bind = eq_bind($bind_ref1, $bind_ref2); # call Test::Builder::ok - $tb->ok($same_sql && $same_bind, $msg); + my $ret = $tb->ok($same_sql && $same_bind, $msg); # add debugging info if (!$same_sql) { @@ -83,6 +83,9 @@ sub is_same_sql_bind { if (!$same_bind) { _bind_differ_diag($bind_ref1, $bind_ref2); } + + # pass ok() result further + return $ret; } sub is_same_sql { @@ -92,12 +95,15 @@ sub is_same_sql { my $same_sql = eq_sql($sql1, $sql2); # call Test::Builder::ok - $tb->ok($same_sql, $msg); + my $ret = $tb->ok($same_sql, $msg); # add debugging info if (!$same_sql) { _sql_differ_diag($sql1, $sql2); } + + # pass ok() result further + return $ret; } sub is_same_bind { @@ -107,12 +113,15 @@ sub is_same_bind { my $same_bind = eq_bind($bind_ref1, $bind_ref2); # call Test::Builder::ok - $tb->ok($same_bind, $msg); + my $ret = $tb->ok($same_bind, $msg); # add debugging info if (!$same_bind) { _bind_differ_diag($bind_ref1, $bind_ref2); } + + # pass ok() result further + return $ret; } sub _sql_differ_diag {