This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get t/uni/cache.t working under minitest
[perl5.git] / t / uni / chr.t
index 33283e7..9445d32 100644 (file)
@@ -8,7 +8,8 @@ BEGIN {
 }
 
 use strict;
-plan (tests => 6);
+plan (tests => 8);
+no warnings 'deprecated';
 use encoding 'johab';
 
 ok(chr(0x7f) eq "\x7f");
@@ -19,4 +20,13 @@ 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__