From: Kyle M Hall Date: Mon, 6 Jul 2020 11:03:21 +0000 (-0400) Subject: Bug 20815: Do not use compare float with precision X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=3b8b542f9e49ab3f7c45aaa7eda33df1607028ef Bug 20815: Do not use compare float with precision Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 2be657d..b886a7b 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -4131,10 +4131,10 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge = undef' => sub { } ); ok( $a, "Found accountline for lost fee" ); - is( $a->amountoutstanding, '42.000000', "Lost fee charged correctly" ); + is( $a->amountoutstanding + 0, 42, "Lost fee charged correctly" ); my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode}, undef, dt_from_string ); $a = Koha::Account::Lines->find( $a->id ); - is( $a->amountoutstanding, '0.000000', "Lost fee was refunded" ); + is( $a->amountoutstanding + 0, 0, "Lost fee was refunded" ); }; subtest 'Tests for NoRefundOnLostReturnedItemsAge > length of days item has been lost' => sub { @@ -4206,10 +4206,10 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge > length of days item has been } ); ok( $a, "Found accountline for lost fee" ); - is( $a->amountoutstanding, '42.000000', "Lost fee charged correctly" ); + is( $a->amountoutstanding + 0, 42, "Lost fee charged correctly" ); my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode}, undef, dt_from_string ); $a = Koha::Account::Lines->find( $a->id ); - is( $a->amountoutstanding, '0.000000', "Lost fee was refunded" ); + is( $a->amountoutstanding + 0, 0, "Lost fee was refunded" ); }; subtest 'Tests for NoRefundOnLostReturnedItemsAge = length of days item has been lost' => sub { @@ -4281,10 +4281,10 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge = length of days item has been } ); ok( $a, "Found accountline for lost fee" ); - is( $a->amountoutstanding, '42.000000', "Lost fee charged correctly" ); + is( $a->amountoutstanding + 0, 42, "Lost fee charged correctly" ); my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode}, undef, dt_from_string ); $a = Koha::Account::Lines->find( $a->id ); - is( $a->amountoutstanding, '42.000000', "Lost fee was not refunded" ); + is( $a->amountoutstanding + 0, 42, "Lost fee was not refunded" ); }; subtest 'Tests for NoRefundOnLostReturnedItemsAge < length of days item has been lost' => sub { @@ -4356,10 +4356,10 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge < length of days item has been } ); ok( $a, "Found accountline for lost fee" ); - is( $a->amountoutstanding, '42.000000', "Lost fee charged correctly" ); + is( $a->amountoutstanding + 0, 42, "Lost fee charged correctly" ); my ( $doreturn, $messages ) = AddReturn( $item->barcode, $library->{branchcode}, undef, dt_from_string ); $a = Koha::Account::Lines->find( $a->id ); - is( $a->amountoutstanding, '42.000000', "Lost fee was not refunded" ); + is( $a->amountoutstanding + 0, 42, "Lost fee was not refunded" ); }; $schema->storage->txn_rollback;