From 7a4e5327bf9ff9f77d87feffe66ba53ec0e7c564 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 23 Feb 2023 09:12:04 +0100 Subject: [PATCH] Bug 31051: Fix test When savings ends with a "0" koha_1 | # Failed test 'Savings correctly calculated from current issues' koha_1 | # at t/db_dependent/Koha/Patron.t line 1380. koha_1 | # got: '34583.70' koha_1 | # expected: '34583.7' koha_1 | koha_1 | # Failed test 'Savings correctly calculated from current and old issues' koha_1 | # at t/db_dependent/Koha/Patron.t line 1385. koha_1 | # got: '34583.70' koha_1 | # expected: '34583.7' koha_1 | # Looks like you failed 2 tests of 4. koha_1 | koha_1 | # Failed test 'get_savings tests' koha_1 | # at t/db_dependent/Koha/Patron.t line 1388. koha_1 | # Looks like you failed 1 test of 20. koha_1 | [00:07:57] t/db_dependent/Koha/Patron.t --- t/db_dependent/Koha/Patron.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t index f0910bd9591..c25b8c49b65 100755 --- a/t/db_dependent/Koha/Patron.t +++ b/t/db_dependent/Koha/Patron.t @@ -1377,12 +1377,12 @@ subtest 'get_savings tests' => sub { AddIssue( $patron->unblessed, $item2->barcode ); my $savings = $patron->get_savings; - is( $savings, $item1->replacementprice + $item2->replacementprice, "Savings correctly calculated from current issues" ); + is( $savings + 0, $item1->replacementprice + $item2->replacementprice, "Savings correctly calculated from current issues" ); AddReturn( $item2->barcode, $item2->homebranch ); $savings = $patron->get_savings; - is( $savings, $item1->replacementprice + $item2->replacementprice, "Savings correctly calculated from current and old issues" ); + is( $savings + 0, $item1->replacementprice + $item2->replacementprice, "Savings correctly calculated from current and old issues" ); $schema->storage->txn_rollback; }; -- 2.25.1