Remove duplicate entries from MANIFEST
[p5sagit/p5-mst-13.2.git] / t / op / bless.t
index 6aea7ba..14ef3d8 100644 (file)
@@ -6,7 +6,7 @@ BEGIN {
     require './test.pl';
 }
 
-plan (106);
+plan (108);
 
 sub expected {
     my($object, $package, $type) = @_;
@@ -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
@@ -124,3 +128,14 @@ $h1 = bless {}, "H4";
 $c4 = eval { bless \$test, $h1 };
 is ($@, '', "class is an overloaded ref");
 expected($c4, 'C4', "SCALAR");
+
+{
+    my %h = 1..2;
+    my($k) = keys %h; 
+    my $x=\$k;
+    bless $x, 'pam';
+    is(ref $x, 'pam');
+
+    my $a = bless \(keys %h), 'zap';
+    is(ref $a, 'zap');
+}