In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/37b8cdd1927432f22e389f8405a9f8a198fb0360?hp=8b1ae794f5e468e8ad34e4bf1d5b02717520b234>
- Log ----------------------------------------------------------------- commit 37b8cdd1927432f22e389f8405a9f8a198fb0360 Author: Rafael Garcia-Suarez <r...@consttype.org> Date: Mon Jun 22 09:46:18 2015 +0200 Increase the maximal size of the string displayed in non-numeric warnings This has the interesting side-effect of "fixing" some of the UTF-8 glob warnings, which indicates that sv_uni_display is probably not dealing with stringified globs correctly. Also add a test for the truncation of strings in the non-numeric warnings. ----------------------------------------------------------------------- Summary of changes: sv.c | 2 +- t/lib/warnings/sv | 8 ++++++++ t/uni/gv.t | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sv.c b/sv.c index 0990be2..7896e18 100644 --- a/sv.c +++ b/sv.c @@ -1828,7 +1828,7 @@ S_sv_display(pTHX_ SV *const sv, char *tmpbuf, STRLEN tmpbuf_size) { if (DO_UTF8(sv)) { SV *dsv = newSVpvs_flags("", SVs_TEMP); - pv = sv_uni_display(dsv, sv, 10, UNI_DISPLAY_ISPRINT); + pv = sv_uni_display(dsv, sv, 32, UNI_DISPLAY_ISPRINT); } else { char *d = tmpbuf; const char * const limit = tmpbuf + tmpbuf_size - 8; diff --git a/t/lib/warnings/sv b/t/lib/warnings/sv index 188e9c6..3d396ef 100644 --- a/t/lib/warnings/sv +++ b/t/lib/warnings/sv @@ -363,6 +363,14 @@ EXPECT Argument "\x{100}\x{200}" isn't numeric in negation (-) at - line 3. ######## # sv.c +use warnings 'numeric' ; +$a = "\x{100}\x{1000}" x 10; $b = $a < 1; +no warnings 'numeric' ; +$a = "\x{100}\x{1000}" x 10; $b = $a < 1; +EXPECT +Argument "\x{100}\x{1000}\x{100}\x{1000}\x{100}..." isn't numeric in numeric lt (<) at - line 3. +######## +# sv.c use warnings 'redefine' ; use utf8; use open qw( :utf8 :std ); diff --git a/t/uni/gv.t b/t/uni/gv.t index 9c48cef..a730297 100644 --- a/t/uni/gv.t +++ b/t/uni/gv.t @@ -127,19 +127,19 @@ is (scalar %á, 0); foreach ($copy, *SKRÃÃÃ) { $msg = ''; my $victim = sprintf "%d", $_; - like($msg, qr/Argument "\*main::(\p{ASCII}|\Q\x{\E\p{ASCII_Hex_Digit}{2}\}){3}\Q...\E" isn't numeric in sprintf/, + like($msg, qr/^Argument "\*main::(?:PW\\x\{d2\}MPF|SKR\\x\{c8\}\\x\{c8\}\\x\{c8\})" isn't numeric in sprintf/, "Warning on conversion to IV"); is($victim, 0); $msg = ''; $victim = sprintf "%u", $_; - like($msg, qr/Argument "\*main::(\p{ASCII}|\Q\x{\E\p{ASCII_Hex_Digit}{2}\}){3}\Q...\E" isn't numeric in sprintf/, + like($msg, qr/^Argument "\*main::(?:PW\\x\{d2\}MPF|SKR\\x\{c8\}\\x\{c8\}\\x\{c8\})" isn't numeric in sprintf/, "Warning on conversion to UV"); is($victim, 0); $msg = ''; $victim = sprintf "%e", $_; - like($msg, qr/Argument "\*main::(\p{ASCII}|\Q\x{\E\p{ASCII_Hex_Digit}{2}\}){3}\Q...\E" isn't numeric in sprintf/, + like($msg, qr/^Argument "\*main::(?:PW\\x\{d2\}MPF|SKR\\x\{c8\}\\x\{c8\}\\x\{c8\})" isn't numeric in sprintf/, "Warning on conversion to NV"); like($victim, qr/^0\.0+E\+?00/i, "Expect floating point zero"); -- Perl5 Master Repository