develooper Front page | perl.perl5.porters | Postings from October 2016

Re: [perl #129954] dist/Carp/t/arg_string.t: Test fails in blead

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
October 27, 2016 08:19
Subject:
Re: [perl #129954] dist/Carp/t/arg_string.t: Test fails in blead
Message ID:
20161027081902.GT3128@iabyn.com
On Mon, Oct 24, 2016 at 06:26:43AM -0700, Dan Collins via RT wrote:
> Here is the bisect:
> 
> HEAD is now at 0e25d86 vax-netbsd: do not tempt fp overflow, which will SIGFPE
> bad - non-zero exit from sh -c cd t && ./perl TEST \.\.\/dist\/Carp\/t\/arg_string\.t
> 0e25d864d83173c105cdabb68813b14c94bae966 is the first bad commit
> commit 0e25d864d83173c105cdabb68813b14c94bae966
> Author: Jarkko Hietaniemi <jhi@iki.fi>
> Date:   Fri Oct 21 09:05:25 2016 -0400
> 
>     vax-netbsd: do not tempt fp overflow, which will SIGFPE
> 
>     The 3e100 seems to have no special meaning, except being in floating point.
> 
> :040000 040000 f9f6d9eb328f42f4573a324789155e44f5f23e6e 5585ec7f232fb5471a6de76756fd3588dbcdd489 M      dist
> bisect run success
> That took 424 seconds.
> 
> Which modified the above test to change from a 3-digit exponent to a 2-digit exponent, and to significantly shorten it. I'd be happy to provide a patch to add an optional leading zero to the test, but I don't know how to handle the issue of Linux trying to print the value as a 37 digit integer. What's the correct behavior here?

I think the test was being overly picky.

I've just pushed the following:

commit 13596abd4f24423e9d589be6da7837c6d1cbb489
Author:     David Mitchell <davem@iabyn.com>
AuthorDate: Thu Oct 27 09:09:24 2016 +0100
Commit:     David Mitchell <davem@iabyn.com>
CommitDate: Thu Oct 27 09:09:24 2016 +0100

    Carp/t/arg_string.t: be liberal in f/p formats
    
    [perl #129954] dist/Carp/t/arg_string.t: Test fails
    
    This test script checks that args are displayed sensibly in longmess()
    output, but floating-point numbers can be displayed in various formats
    depending on platform, so make the regex more forgiving.
    
    Also add a comment to the top of the script explaining its purpose.


Affected files ...
    M	dist/Carp/t/arg_string.t

Differences ...

diff --git a/dist/Carp/t/arg_string.t b/dist/Carp/t/arg_string.t
index c94ec48..4c754c5 100644
--- a/dist/Carp/t/arg_string.t
+++ b/dist/Carp/t/arg_string.t
@@ -1,6 +1,8 @@
 use warnings;
 use strict;
 
+# confirm that stack args are displayed correctly by longmess()
+
 use Test::More tests => 32;
 
 use Carp ();
@@ -22,7 +24,11 @@ like lm(3), qr/main::lm\(3\)/;
 like lm(substr("3\x{2603}", 0, 1)), qr/main::lm\(3\)/;
 like lm(-3), qr/main::lm\(-3\)/;
 like lm(-3.5), qr/main::lm\(-3\.5\)/;
-like lm(-3.5e30), qr/main::lm\(-3\.5[eE]\+?30\)/;
+like lm(-3.5e30),
+            qr/main::lm\(
+                -3500000000000000000000000000000
+              | -3\.5[eE]\+?0?30\)
+            /x;
 like lm(""), qr/main::lm\(""\)/;
 like lm("foo"), qr/main::lm\("foo"\)/;
 like lm("a\$b\@c\\d\"e"), qr/main::lm\("a\\\$b\\\@c\\\\d\\\"e"\)/;


-- 
I thought I was wrong once, but I was mistaken.

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