From cb990f41d37ddb017ea7902c90a0beddc6afa44d Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Thu, 4 Feb 2021 19:35:02 +0000 Subject: [PATCH] Bug 27630: Add tests To test: 1. prove t/db_dependent/TestBuilder.t 2. Observe failing test t/db_dependent/TestBuilder.t .. 3/13 Failed test 'There can be more decimals when the column size allows it.' at t/db_dependent/TestBuilder.t line 101. got: '67631.42' expected: '67631.420000' Looks like you failed 1 test of 4. Sponsored-by: The National Library of Finland --- t/db_dependent/TestBuilder.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t index e2fbba7a9b..ddfd7e7a10 100755 --- a/t/db_dependent/TestBuilder.t +++ b/t/db_dependent/TestBuilder.t @@ -84,7 +84,7 @@ subtest 'Build all sources' => sub { subtest 'Test length of some generated fields' => sub { - plan tests => 3; + plan tests => 4; # Test the length of a returned character field my $bookseller = $builder->build({ source => 'Aqbookseller' }); @@ -96,6 +96,11 @@ subtest 'Test length of some generated fields' => sub { my $item = $builder->build({ source => 'Item' }); is( $item->{replacementprice}, sprintf("%.2f", $item->{replacementprice}), "The number of decimals for floats should not be more than 2" ); + my $accountline = $builder->build({ source => 'Accountline' }); + is( $accountline->{amountoutstanding}, + sprintf("%.6f", $accountline->{amountoutstanding}), + "There can be more decimals when the column size allows it." ); + }; -- 2.17.1