From 97bfb510fa68032bd052cd69dc41c5a0569fe19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Sat, 10 Jun 2017 08:15:29 +0200 Subject: [PATCH] Bug 18774: Add test for Price.pm Add a test for a big number to t/Number/Price.t Test will fail with: round() overflow. Try smaller precision or use Math::BigFloat at (...)/Koha/Number/Price.pm line 44. Signed-off-by: Lee Jamison Test failure occurs as described. This patch passes QA tools. --- t/Number/Price.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/Number/Price.t b/t/Number/Price.t index ad4f0cf..173d45f 100644 --- a/t/Number/Price.t +++ b/t/Number/Price.t @@ -1,6 +1,6 @@ use Modern::Perl; -use Test::More tests => 28; +use Test::More tests => 29; use Test::MockModule; use t::lib::Mocks; @@ -27,6 +27,9 @@ is( Koha::Number::Price->new->format( $format ), '0.00', 'US: format 0' ); is( Koha::Number::Price->new(3)->format( $format ), '3.00', 'US: format 3' ); is( Koha::Number::Price->new(1234567890)->format( $format ), '1,234,567,890.00', 'US: format 1234567890' ); +# Test a very big number +is( Koha::Number::Price->new(99999999999999)->format( $format ), + '99,999,999,999,999.00', 'US: format 99999999999999' ); # FIXME This should be display symbol, but it was the case before the creation of this module is( Koha::Number::Price->new->format( { %$format, with_symbol => 1 } ), -- 2.1.4