diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-02-06 22:29:45 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-02-06 22:29:45 +0000 |
commit | 40ff300dec6feccc3604f666dbf63e5fa5916402 (patch) | |
tree | efdf395dc67213ed9c1c217f517369de20911c31 /t | |
parent | 8158862b9267dedf3d655e89b8b936586bfeeefa (diff) | |
download | perl-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.t | 12 |
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 |