diff options
author | David Mitchell <davem@iabyn.com> | 2016-10-27 09:09:24 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-10-27 09:09:24 +0100 |
commit | 13596abd4f24423e9d589be6da7837c6d1cbb489 (patch) | |
tree | 90f9af47608af1590473cf0c450fa314ea29c65d /dist/Carp | |
parent | e5d8cfc54f46edb55f615c1b070d809c6a47efb7 (diff) | |
download | perl-13596abd4f24423e9d589be6da7837c6d1cbb489.tar.gz |
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.
Diffstat (limited to 'dist/Carp')
-rw-r--r-- | dist/Carp/t/arg_string.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/dist/Carp/t/arg_string.t b/dist/Carp/t/arg_string.t index c94ec48ece..4c754c532c 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"\)/; |