Change 30149 by [EMAIL PROTECTED] on 2007/02/06 22:29:45

        Avoid obscure failures when a regexp hasn't matched

Affected files ...

... //depot/perl/t/op/bless.t#8 edit

Differences ...

==== //depot/perl/t/op/bless.t#8 (text) ====
Index: perl/t/op/bless.t
--- perl/t/op/bless.t#7~25054~  2005-07-02 09:53:09.000000000 -0700
+++ perl/t/op/bless.t   2007-02-06 14:29:45.000000000 -0800
@@ -14,10 +14,14 @@
     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
End of Patch.

Reply via email to