Skip Menu |

This queue is for tickets about the Acme-Tools CPAN distribution.

Report information
The Basics
Id: 121321
Status: new
Priority: 0/
Queue: Acme-Tools

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.20
  • 0.21
Fixed in: (no value)



Subject: Fails with uselongdouble since 0.20: t/02_general.t
As per subject. Sample fail report: http://www.cpantesters.org/cpan/report/59661388-0f61-11e7-a521-3d62c125df9b The diagnostics look stupid: # Failed test 'nicenum1 0.3 --> 0.3 --> 0.3' # at t/02_general.t line 417. # got: 0.3 # expected: 0.3 # Looks like you failed 1 test of 173. t/02_general.t .................. Dubious, test returned 1 (wstat 256, 0x100) ATM I cannot explain, hopefully somebody else can. HTH&&Thanks,
A rule of thumb on this kind of test failures is to compare floating point numbers only with some epsilon. A convenient module to do so is Test::Number::Delta. Here is a patch: --- t/02_general.t~ 2017-06-23 02:59:21.409349487 +0000 +++ t/02_general.t 2017-06-23 03:03:56.786927083 +0000 @@ -3,6 +3,7 @@ BEGIN{require 't/common.pl'} use Test::More tests => 173; +use Test::Number::Delta; use Digest::MD5 qw(md5_hex); my @empty; @@ -414,6 +415,6 @@ # print 34.3 - 34.0; # 0.299999999999997 my($inn,$n,$nn)=(0); my $nndebugstr=sub{++$inn;"nicenum$inn $n --> $Acme::Tools::Nicenum --> $nn"}; -$nn=nicenum( $n = 14.3 - 14.0 ); cmp_ok($nn,'==',0.3, &$nndebugstr); +$nn=nicenum( $n = 14.3 - 14.0 ); delta_within($nn,0.3,1e-9); $nn=nicenum( $n = 34.3 - 34.0 ); cmp_ok($nn,'==',0.3, &$nndebugstr); $nn=nicenum( $n = 1e8+1 ); cmp_ok($nn,'==',1e8+1, &$nndebugstr); HTH&&Thanks,