On Tue Feb 26 01:33:54 2008, IMACAT wrote:
Show quoted text> On Sun Jan 06 22:49:05 2008, hjp@hjp.at wrote:
> > Well, I added tests for all the new opcodes, and fixed some of the old
> > ones. There may still be some bugs, but the tests all pass now and they
> > cover all source lines, so I guess it's clean enough now.
>
> Hi. This is imacat from Taiwan. Sorry for the reply late.
No problem. I'm late, too (somehow I expected rt to send me mail if the
ticket changes, but apparently it doesn't) and the Simon is late, too
;-).
Show quoted text> Well, your test suites fails.
>
> 1. That t/tmp is read-only after untarring the source.
It shouldn't be in source. Apparently I added it to the MANIFEST by
mistake. (And the tests which create it should probably remove it when
they are finished).
Show quoted text> I would suggest you to untar your "./Build dist" source and test
> again before release.
Good advice. I'll keep it in mind.
Show quoted text> 2. That float comparison fails at t/09binnumbers.t. The failure is
> attached below:
>
> imacat@cotton tmp/Python-Serialise-Pickle-0.02 % perl -Iblib/lib
> t/09binnumbers.t
> 1..7
> ok 1 - use Python::Serialise::Pickle;
> ok 2
> LOAD
> ok 3 - binint1
> LOAD
> ok 4 - binint2
> LOAD
> ok 5 - binint (positive)
> LOAD
> ok 6 - binint (negative)
> LOAD
> not ok 7 - binfloat
> # Failed test 'binfloat'
> # at t/09binnumbers.t line 15.
> # got: '3.14000000000000012'
> # expected: '3.14'
> # Looks like you failed 1 test of 7.
> imacat@cotton tmp/Python-Serialise-Pickle-0.02 %
>
> I suppose this fails on x86_64 and "i386 compiled with
uselongdouble".
Yes, that's expected. The test was designed to check if the result is
exact with 64 bit doubles. It cannot work with longer (or shorter)
doubles. It could be skipped for other sizes, but there is a better way
...
Show quoted text> I do not remember how others solve this, but I suppose you can use:
>
> is(sprintf("%f", $ps->load) + 0, 3.14, "binfloat");
Nope, that doesn't check if the result is exactly what it should be.
A better test would be
is($ps->load, 3.140000000000000124344978758017532527446746826171875,
"binfloat");
that should work with all possible floating point representations.
hp