summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-02-06 22:29:45 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-02-06 22:29:45 +0000
commit40ff300dec6feccc3604f666dbf63e5fa5916402 (patch)
treeefdf395dc67213ed9c1c217f517369de20911c31 /t
parent8158862b9267dedf3d655e89b8b936586bfeeefa (diff)
downloadperl-40ff300dec6feccc3604f666dbf63e5fa5916402.tar.gz
Avoid obscure failures when a regexp hasn't matched
p4raw-id: //depot/perl@30149
Diffstat (limited to 't')
-rw-r--r--t/op/bless.t12
1 files changed, 8 insertions, 4 deletions
diff --git a/t/op/bless.t b/t/op/bless.t
index 6aea7ba7e0..d5ae885b52 100644
--- a/t/op/bless.t
+++ b/t/op/bless.t
@@ -14,10 +14,14 @@ sub expected {
is(ref($object), $package);
my $r = qr/^\Q$package\E=(\w+)\(0x([0-9a-f]+)\)$/;
like("$object", $r);
- "$object" =~ $r;
- is($1, $type);
- # in 64-bit platforms hex warns for 32+ -bit values
- cmp_ok(do {no warnings 'portable'; hex($2)}, '==', $object);
+ if ("$object" =~ $r) {
+ is($1, $type);
+ # in 64-bit platforms hex warns for 32+ -bit values
+ cmp_ok(do {no warnings 'portable'; hex($2)}, '==', $object);
+ }
+ else {
+ fail(); fail();
+ }
}
# test blessing simple types