Bugzilla – Attachment 116340 Details for
Bug 27630
TestBuilder real number formatting is different to DBI(x)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27630: Add test to prove different behavior with floats
Bug-27630-Add-test-to-prove-different-behavior-wit.patch (text/plain), 2.14 KB, created by
Lari Taskula
on 2021-02-04 21:08:22 UTC
(
hide
)
Description:
Bug 27630: Add test to prove different behavior with floats
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2021-02-04 21:08:22 UTC
Size:
2.14 KB
patch
obsolete
>From d71fa8e4f5d31b1e0404acfedc3e2036d633bd05 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Thu, 4 Feb 2021 21:05:42 +0000 >Subject: [PATCH] Bug 27630: Add test to prove different behavior with floats > >To test: >1. prove t/db_dependent/TestBuilder.t >2. It might or might not pass all tests - if it passes, run it again > until you get the following error (always with the "float" step): > > ok 5 - decimal - Builder builds same precision as DBIx returns. > not ok 6 - 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 112. > got: '51.7080' > expected: '51.708' > Looks like you failed 1 test of 6. > >Sponsored-by: The National Library of Finland >--- > t/db_dependent/TestBuilder.t | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t >index ddfd7e7a10..aa21b801e1 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 => 4; >+ plan tests => 6; > > # Test the length of a returned character field > my $bookseller = $builder->build({ source => 'Aqbookseller' }); >@@ -101,6 +101,17 @@ subtest 'Test length of some generated fields' => sub { > sprintf("%.6f", $accountline->{amountoutstanding}), > "There can be more decimals when the column size allows it." ); > >+ my $rs = $schema->source('Accountline')->resultset; >+ my $accountline_dbix = $rs->find($accountline->{accountlines_id}); >+ is( $accountline->{amountoutstanding}, $accountline_dbix->amountoutstanding, >+ "decimal - Builder builds same precision as DBIx returns." ); >+ >+ my $aqorder = $builder->build({ source => 'Aqorder' }); >+ $rs = $schema->source('Aqorder')->resultset; >+ my $aqorder_dbix = $rs->find($aqorder->{ordernumber}); >+ is( $aqorder->{discount}, $aqorder_dbix->discount, >+ "float - Builder builds same precision as DBIx returns." ); >+ > }; > > >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27630
:
116336
|
116337
|
116340
|
116342
|
116426
|
116427
|
116440
|
116441