use sprintf for floating point comparisons in common tests
Rafael Kitover [Wed, 13 Apr 2011 08:38:16 +0000 (04:38 -0400)]
t/lib/dbixcsl_common_tests.pm

index 75e2e61..136af6b 100644 (file)
@@ -498,13 +498,13 @@ sub test_schema {
             'constant negative integer default',
         );
 
-        cmp_ok(
-            $class35->column_info('a_double')->{default_value}, '==', 10.555,
+        is(
+            sprintf("%.3f", $class35->column_info('a_double')->{default_value}), '10.555',
             'constant numeric default',
         );
 
-        cmp_ok(
-            $class35->column_info('a_negative_double')->{default_value}, '==', -10.555,
+        is(
+            sprintf("%.3f", $class35->column_info('a_negative_double')->{default_value}), -10.555,
             'constant negative numeric default',
         );