The t/limits_trans_err.t test fails on a debian/wheezy system if perl is compiled with -Duselongdouble (checked with perl 5.20.1):
# Failed test 'x symmetric trans' # at t/limits_trans_err.t line 30. # Structures begin differing at: # $got->[0] = '-0.301029995663981198' # $expected->[0] = '-0.301029995663981195' # Failed test 'x asymmetric trans' # at t/limits_trans_err.t line 35. # Structures begin differing at: # $got->[0] = '-0.301029995663981198' # $expected->[0] = '-0.301029995663981195' # Failed test 'illegal errbar lower bounds' # at t/limits_trans_err.t line 42. # Structures begin differing at: # $got->[0] = '-0.301029995663981198' # $expected->[0] = '-0.301029995663981195' # Looks like you failed 3 tests of 3. t/limits_trans_err.t ............
On a FreeBSD 10 system the test suite also fails if perl is compiled with -Duselongdouble, but a different test:
# Failed test 'q[e] returns exp(1)' # at t/pdl_from_string.t line 301. # got: '2.71828182845904509' # expected: '2.71828182845904553' # Got 2.71828182845904509 # Failed test 'q[E] returns exp(1)' # at t/pdl_from_string.t line 304. # got: '2.71828182845904509' # expected: '2.71828182845904553' # Got 2.71828182845904509 # Looks like you failed 2 tests of 113. t/pdl_from_string.t ............. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/113 subtests (less 1 skipped subtest: 110 okay) (3 TODO tests unexpectedly succeeded)
Regards,
Slaven
Thanks for reporting the problem. We're in the process of cleaning up the tests and changing floating point comparisons for equality to numerical equality with an allowed tolerance is part of that.
Adding this to the list of test fixes for PDL. Sivoais may already have addressed these.
I don't see an easy way to add approximate equality to the current tests. I suggest marking them TODO again for PDL-2.014.
kmx has pointed out that there are some CPAN modules that could be used to fix the problem and the expense of additional PDL dependencies. Thoughts?
A possible solution is to check using POSIX::DBL_EPSILON, see here: https://books.google.de/books?id=z9xMfXGoWd0C&lpg=PA473&ots=6OAMoo-vLt&dq=%22DBL_EPSILON%22%20perl%20test&hl=hr&pg=PA473#v=onepage&q=%22DBL_EPSILON%22%20perl%20test&f=false
The problem tests are marked TODO and I'm lowering the priority as this is not needed for PDL-2.014.
Replaced is() by ok( approx($x,$y,1e-15). Now the difference between the results between perls with uselongdouble set and the PDL double type (which is the only one supported) shouldn't matter. Need to check on a long double perl system.