From: Rafael Kitover Date: Wed, 13 Apr 2011 08:38:16 +0000 (-0400) Subject: use sprintf for floating point comparisons in common tests X-Git-Tag: 0.07011~130 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=740241f7a031dea58f6aeb8cf9a2cba1cfe5c92e;p=dbsrgits%2FDBIx-Class-Schema-Loader.git use sprintf for floating point comparisons in common tests --- diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 75e2e61..136af6b 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -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', );