diff options
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | t/lib/warnings/pp | 10 | ||||
-rw-r--r-- | t/uni/chr.t | 31 |
3 files changed, 10 insertions, 32 deletions
@@ -5717,7 +5717,6 @@ t/uni/cache.t See if Unicode swash caching works t/uni/caller.t See if Unicode doesn't get mangled in caller() t/uni/case.pl See if Unicode casing works t/uni/chomp.t See if Unicode chomp works -t/uni/chr.t See if Unicode chr works t/uni/class.t See if Unicode classes work (\p) t/uni/eval.t See if Unicode hints don't affect eval() t/uni/fold.t See if Unicode folding works diff --git a/t/lib/warnings/pp b/t/lib/warnings/pp index 3324ccc563..3eef12a208 100644 --- a/t/lib/warnings/pp +++ b/t/lib/warnings/pp @@ -21,6 +21,10 @@ Constant subroutine (anonymous) undefined $foo = sub () { 3 }; undef &$foo; + Use of strings with code points over 0xFF as arguments to 1's complement (~) operator is deprecated + + Invalid negative number (%s) in chr + __END__ # pp.c use warnings 'substr' ; @@ -136,3 +140,9 @@ EXPECT OPTION regex Use of strings with code points over 0xFF as arguments to 1's complement \(~\) operator is deprecated at - line \d+. Use of code point 0xFF+EFF is deprecated; the permissible max is 0x7F+ at - line \d+. +######## +# NAME chr -1 +use warnings 'utf8'; +my $chr = chr(-1); +EXPECT +Invalid negative number (-1) in chr at - line 2. diff --git a/t/uni/chr.t b/t/uni/chr.t deleted file mode 100644 index 3392a09fd9..0000000000 --- a/t/uni/chr.t +++ /dev/null @@ -1,31 +0,0 @@ -#!./perl -w - -BEGIN { - chdir 't' if -d 't'; - require './test.pl'; - skip_all_without_dynamic_extension('Encode'); - skip_all("no encoding pragma in EBCDIC") if $::IS_EBCDIC; - skip_all_without_perlio(); -} - -use strict; -plan (tests => 8); - -ok(chr(0x7f) eq "\x7f"); -ok(chr(0x80) eq "\x80"); -ok(chr(0xff) eq "\xff"); - -for my $i (127, 128, 255) { - ok(chr($i) eq pack('C', $i)); -} - -# [perl #83048] -{ - my $w; - local $SIG{__WARN__} = sub { $w .= $_[0] }; - my $chr = chr(-1); - is($chr, "\x{fffd}", "invalid values become REPLACEMENT CHARACTER"); - like($w, qr/^Invalid negative number \(-1\) in chr at /, "with a warning"); -} - -__END__ |