[Koha-bugs] [Bug 27630] TestBuilder real number formatting is different to DBI(x)

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Feb 6 10:17:24 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27630

David Nind <david at davidnind.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #116426|0                           |1
        is obsolete|                            |

--- Comment #10 from David Nind <david at davidnind.com> ---
Created attachment 116440
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116440&action=edit
Bug 27630: Add tests

This proves different behavior between floats and decimals for values
built by TestBuilder vs values returned by DBI/DBIx.

To test:
1. prove t/db_dependent/TestBuilder.t
2. Observe failure

 Subtest: _gen_real formatting
        1..4
        not ok 1 - There can be more decimals when the column size allows it.
           Failed test 'There can be more decimals when the column size allows
it.'
           at t/db_dependent/TestBuilder.t line 112.
                  got: '10.10'
             expected: '10.100000'
        not ok 2 - decimal - Builder builds same format as DBIx returns.
           Failed test 'decimal - Builder builds same format as DBIx returns.'
           at t/db_dependent/TestBuilder.t line 118.
                  got: '10.10'
             expected: '10.100000'
        not ok 3 - float - Builder builds same precision as DBIx returns.
           Failed test 'float - Builder builds same precision as DBIx returns.'
           at t/db_dependent/TestBuilder.t line 124.
                  got: '10.10'
             expected: '10.1'
        not ok 4 - double - Builder builds same precision as DBIx returns.
           Failed test 'double - Builder builds same precision as DBIx
returns.'
           at t/db_dependent/TestBuilder.t line 131.
                  got: '10.10'
             expected: '10.1'
         Looks like you failed 4 tests of 4.
    not ok 4 - _gen_real formatting
       Failed test '_gen_real formatting'

Sponsored-by: The National Library of Finland

Signed-off-by: David Nind <david at davidnind.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list