[Jifty-commit] r5185 - in Jifty-DBI/trunk: t

Jifty commits jifty-commit at lists.jifty.org
Fri Feb 29 20:13:03 EST 2008


Author: sartak
Date: Fri Feb 29 20:13:01 2008
New Revision: 5185

Modified:
   Jifty-DBI/trunk/   (props changed)
   Jifty-DBI/trunk/t/06filter_boolean.t

Log:
 r52278 at onn:  sartak | 2008-02-29 20:11:49 -0500
 Fix final test failure: toggle pg_bool_tf before making the query


Modified: Jifty-DBI/trunk/t/06filter_boolean.t
==============================================================================
--- Jifty-DBI/trunk/t/06filter_boolean.t	(original)
+++ Jifty-DBI/trunk/t/06filter_boolean.t	Fri Feb 29 20:13:01 2008
@@ -53,20 +53,20 @@
 
         is($rec->my_data, $bool eq 'true' ? 1 : 0, 'Perl agrees with the expected boolean value');
 
-        my $sth = $handle->simple_query("SELECT my_data FROM users WHERE id = $id");
-        my ($got) = $sth->fetchrow_array;
-
         if ($d eq 'Pg') {
             # this option tells DBD::Pg to keep booleans as 't' and 'f' and not
             # map them to 1 and 0
-            $handle->dbh->{pg_bool_tf} = 0;
+            $handle->dbh->{pg_bool_tf} = 1;
         }
 
+        my $sth = $handle->simple_query("SELECT my_data FROM users WHERE id = $id");
+        my ($got) = $sth->fetchrow_array;
+
         my $method = "canonical_$bool";
         is( $got, $handle->$method, "my_data bool match for " . (defined($input) ? $input : 'undef') . " ($bool)" );
 
         if ($d eq 'Pg') {
-            $handle->dbh->{pg_bool_tf} = 1;
+            $handle->dbh->{pg_bool_tf} = 0;
         }
 
         # undef/NULL


More information about the Jifty-commit mailing list