17 object_ok($a, 'Regexp');
19 object_ok($b, 'Regexp');
23 isnt($a + 0, $b + 0, 'Not the same object');
28 object_ok($a, 'Regexp');
29 object_ok($b1, 'Pie');
38 isnt($c + 0, $d + 0, 'Not the same object');
46 # Assignment to an implicitly blessed Regexp object retains the class
47 # (No different from direct value assignment to any other blessed SV
49 object_ok($d, 'Regexp');
50 like("$d", qr/\ARegexp=SCALAR\(0x[0-9a-f]+\)\z/);
52 # As does an explicitly blessed Regexp object.
54 my $e = bless qr/Faux Pie/, 'Stew';
56 object_ok($e, 'Stew');
60 object_ok($e, 'Stew');
61 like("$e", qr/\Stew=SCALAR\(0x[0-9a-f]+\)\z/);
63 # [perl #96230] qr// should not have the reuse-last-pattern magic
65 like "bar",qr//,'[perl #96230] =~ qr// does not reuse last successful pat';
69 is $_, "bazbar", '[perl #96230] s/$qr// does not reuse last pat';
72 my $x = 1.1; $x = ${qr//};
73 pass 'no assertion failure when upgrading NV to regexp';
76 sub TIESCALAR{bless[]}
77 sub STORE { is ref\pop, "REGEXP", "stored regexp" }
80 ok tied $t, 'tied var is still tied after regexp assignment';
84 is ref \$t2, 'main', 'regexp assignment is not maledictory';
88 local $SIG{__WARN__}=sub{$w=$_[0]};
91 is 0+$_, 0, 'double upgraded to regexp';
92 like $w, qr/numeric/, 'produces non-numeric warning';
96 is 0+$_, 0, 'int upgraded to regexp';
97 like $w, qr/numeric/, 'likewise produces non-numeric warning';
101 $_[0] = ${qr=crumpets=};
102 is ref\$_[0], 'REGEXP', 'PVLVs';
103 # Don’t use like() here, as we would no longer be testing a PVLV.
104 ok " crumpets " =~ $_[0], 'using a regexpvlv as regexp';
106 is ref\$x, 'REGEXP', 'copying a regexpvlv';
110 is $_[0], "$str ", 'stringifying regexpvlv in place';
112 ->((\my%hash)->{key});