develooper Front page | perl.perl5.porters | Postings from April 2019

Re: [perl #134038] ext/POSIX/t/posix.t patch to fix deficiency intest suite

Thread Previous | Thread Next
From:
Karl Williamson
Date:
April 17, 2019 03:34
Subject:
Re: [perl #134038] ext/POSIX/t/posix.t patch to fix deficiency intest suite
Message ID:
896bfb68-ef08-1063-0dd4-b18fb18ca1a9@khwilliamson.com
On 4/16/19 7:25 PM, sisyphus wrote:
> Yeah - so much for perl's claim that it's guided by the principle of 
> "least surprise" ;-)
> 
> Assuming you're running this test script on the current blead branch, I 
> believe the result is as expected.
> The "got" and "expected" values are, in fact, different - but perl's 
> print() function rounds them to the same output.
> 
> IOW, perl is behaving exactly as I expect, and I therefore saw no need 
> to change anything.
> 
> I did consider rewriting the test as (untried):
> 
> cmp_ok(unpack("h*", pack("d", $n)),  'eq', unpack("h*", pack("d", 
>   8.87359152e-6)),  'strtod and perl agree');
> 
> because that would then show that "got" and "expected" were dfifferent, 
> but that just looked messy and unclear.
> 
> Anyway, if there's a view that the test needs to be rewritten, then I'll 
> go along with it ... albeit somewhat grumpily.
> I'm not all that fussed about how this sort of thing is detected, but 
> clearly there needs to be something in the test suite that catches this 
> event that we've just experienced.

I think either the test name should say something, or a comment for 
those tests that they may look the same, but aren't.  It confused me, 
and I started to change the operator to eq and ne before I figured it out.

But it looks like the branch is working
> 
> Cheers,
> Rob
> 
> 
> 
> On Wed, Apr 17, 2019 at 9:49 AM James E Keenan via RT 
> <perlbug-followup@perl.org <mailto:perlbug-followup@perl.org>> wrote:
> 
>     On Tue, 16 Apr 2019 12:49:35 GMT, sisyphus359@gmail.com
>     <mailto:sisyphus359@gmail.com> wrote:
>      > Hi,
>      > As discussed in recent postings to
>      > https://rt.perl.org/Ticket/Display.html?id=133945, at some time
>     in the last
>      > few days blead stopped  using Perl_strtod to assign floating
>     point values
>      > and reverted to the using its buggy atof functionality instead.
>      >
>      > There is nothing in the test suite that detects such an occurrence,
>      > The attached patch to posix.t remedies that by checking that 
>     specific
>      > 'double', 'long double' and '__float128' values (known to be assigned
>      > incorrectly by perl's atof routines) are being assigned correctly.
>      >
>      > Cheers,
>      > Rob
> 
> 
>     I created a (local) branch from blead in which I applied this
>     patch.  I then ran make test_harness and the result was FAIL.  The
>     result is puzzling:
> 
>     #####
>     $ cd t;./perl harness -v ../ext/POSIX/t/posix.t; cd -
> 
>     ok 1 - O_RDONLY with open
>     ok 2 -     with read
>     not ok 3 -     read to array element # TODO read to array element
>     not working
>     ok 4
>     ok 5 - POSIX::pipe
>     ...
>     ok 16 - strtod works
>     not ok 17 - strtod and perl agree
> 
>     #   Failed test 'strtod and perl agree'
>     #   at t/posix.t line 180.
>     #          got: 8.87359152e-06
>     #     expected: 8.87359152e-06
>     ok 18 - strtold works
>     ...
>     ok 96 - tmpnam advises File::Temp
>     Failed 1/96 subtests
>              (less 2 skipped subtests: 93 okay)
> 
>     Test Summary Report
>     -------------------
>     ../ext/POSIX/t/posix.t (Wstat: 0 Tests: 96 Failed: 1)
>        Failed test:  17
>     Files=1, Tests=96,  3 wallclock secs ( 0.02 usr  0.01 sys +  0.06
>     cusr  0.01 csys =  0.10 CPU)
>     Result: FAIL
>     #####
> 
>     -- 
>     James E Keenan (jkeenan@cpan.org <mailto:jkeenan@cpan.org>)
> 
>     ---
>     via perlbug:  queue: perl5 status: new
>     https://rt.perl.org/Ticket/Display.html?id=134038
> 

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About