This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
B/Deparse.pm: Rework deparsing of UTF-8 tr///
[perl5.git] / lib / overloading.t
index 787edb1..85fc7e2 100644 (file)
@@ -1,6 +1,6 @@
 #./perl
 
-use Test::More tests => 46;
+use Test::More tests => 50;
 
 use Scalar::Util qw(refaddr);
 
@@ -50,6 +50,16 @@ is( cos($x), "far side of overload table", "cosinusfies" );
     is( 0 + $x, 42, "numifies" );
     is( cos($x), "far side of overload table", "cosinusfies" );
 
+    my $q = qr/abc/;
+    ok "abc" =~ $q, '=~ qr// with no "" overloading';
+    ok "abcd" =~ /${q}d/, '=~ /foo$qr/ with no "" overloading';
+    {
+       no overloading 'qr';
+       my $q = qr/abc/;
+       ok "abc" =~ $q, '=~ qr// with no "" or qr overloading';
+       ok "abcd" =~ /${q}d/, '=~ /foo$qr/ with no "" or qr overloading';
+    }
+
     {
        no overloading;
        is( "$x", overload::StrVal($x), "no stringification" );