Actions
Bug #439
closedBug 27630 - TestBuilder real number precision to use column's size
Sponsored-by:
The National Library of Finland
Koha Bugzilla Bug#:
Description
t::lib::TestBuilder::_gen_real() always returns 2 decimal places no matter the column's size definition.
TestBuilder.pm _gen_real()
printf("%.2f", rand($max-0.1));
Our database has decimal type columns with higher than 2 decimal places. This makes comparing structures with Test::More::is_deeply impossible when the other object is built by TestBuilder, and the other fetched from database, as seen here:
- Structures begin differing at:
- $got->[0]{amount} = '90203.710000'
- $expected->[0]{amount} = '90203.71'
Actions