[Bps-public-commit] dbix-searchbuilder branch master updated. 1.71-25-g203f48d

BPS Git Server git at git.bestpractical.com
Thu Dec 8 16:54:32 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, master has been updated
       via  203f48d152934b8d278bbe8de42439e34d5ea8d3 (commit)
       via  0d28ae1eefc1df5281679a8e0abc4a91044b6f79 (commit)
      from  c207ed5ecba0e925ec363e060bfe16803626fd82 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 203f48d152934b8d278bbe8de42439e34d5ea8d3
Merge: c207ed5 0d28ae1
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Dec 8 11:54:04 2022 -0500

    Merge branch 'update-datetime-interval-tests-for-pg-14'


commit 0d28ae1eefc1df5281679a8e0abc4a91044b6f79
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..fa5abbf 100644
--- a/t/02records_dt_interval.t
+++ b/t/02records_dt_interval.t
@@ -44,7 +44,14 @@ SKIP: {
     );
 
     while ( my $user = $users->Next ) {
-        is $user->__Value( $column ), $user->Result;
+        if ( defined $user->Result ) {
+            # Use an explicit numeric compare rather than 'is' to
+            # work around values like 90061.000000 returned in Pg 14+
+            ok( $user->__Value($column) == $user->Result );
+        }
+        else {
+            ok( !defined $user->__Value($column) );
+        }
     }
 
     $users = TestApp::Users->new( $handle );
@@ -57,7 +64,14 @@ SKIP: {
     );
 
     while ( my $user = $users->Next ) {
-        is $user->__Value( $column ), $user->Result;
+        if ( defined $user->Result ) {
+            # Use an explicit numeric compare rather than 'is' to
+            # work around values like 90061.000000 returned in Pg 14+
+            ok( $user->__Value($column) == $user->Result );
+        }
+        else {
+            ok( !defined $user->__Value($column) );
+        }
     }
 
     cleanup_schema( 'TestApp', $handle );

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

Summary of changes:
 t/02records_dt_interval.t | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
dbix-searchbuilder


More information about the Bps-public-commit mailing list