[Bps-public-commit] dbix-searchbuilder branch update-datetime-interval-tests-for-pg-14 created. 1.71-15-g1b07d2e

BPS Git Server git at git.bestpractical.com
Mon Oct 24 18:54:18 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dbix-searchbuilder".

The branch, update-datetime-interval-tests-for-pg-14 has been created
        at  1b07d2e9840ca13cb2be15bb37d67970ea7c7bea (commit)

- Log -----------------------------------------------------------------
commit 1b07d2e9840ca13cb2be15bb37d67970ea7c7bea
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Oct 25 02:20:10 2022 +0800

    Use numeric comparison to get rid of precision changes in Pg 14
    
    Pg 14 changed EXTRACT() to return type numeric, the value is like
    90061.000000 instead of 90061. This commit switches to numeric
    comparision so the 2 values can still be equal.

diff --git a/t/02records_dt_interval.t b/t/02records_dt_interval.t
index 283746f..bcf84eb 100644
--- a/t/02records_dt_interval.t
+++ b/t/02records_dt_interval.t
@@ -44,7 +44,12 @@ SKIP: {
     );
 
     while ( my $user = $users->Next ) {
-        is $user->__Value( $column ), $user->Result;
+        if ( defined $user->Result ) {
+            ok( $user->__Value($column) == $user->Result );
+        }
+        else {
+            ok( !defined $user->__Value($column) );
+        }
     }
 
     $users = TestApp::Users->new( $handle );
@@ -57,7 +62,12 @@ SKIP: {
     );
 
     while ( my $user = $users->Next ) {
-        is $user->__Value( $column ), $user->Result;
+        if ( defined $user->Result ) {
+            ok( $user->__Value($column) == $user->Result );
+        }
+        else {
+            ok( !defined $user->__Value($column) );
+        }
     }
 
     cleanup_schema( 'TestApp', $handle );

-----------------------------------------------------------------------


hooks/post-receive
-- 
dbix-searchbuilder


More information about the Bps-public-commit mailing list