Support blessed shared references.
[p5sagit/p5-mst-13.2.git] / ext / threads / shared / t / hv_refs.t
index fb3c8de..66df0a6 100644 (file)
@@ -30,7 +30,7 @@ sub skip {
 
 use ExtUtils::testlib;
 use strict;
-BEGIN { print "1..14\n" };
+BEGIN { print "1..17\n" };
 use threads;
 use threads::shared;
 ok(1,1,"loaded");
@@ -84,7 +84,15 @@ ok(10, keys %foo == 0, "And make sure we realy have deleted the values");
   ok(14, 1, "lock on helems now work, this was bug 10045");
 
 }
-
+{
+    my $object : shared = &share({});
+    threads->new(sub { bless $object, 'test1' });
+    ok(15, ref($object) eq 'test1', "blessing does work");
+    my %test = (object => $object);
+    ok(16, ref($test{object}) eq 'test1', "and some more work");
+    bless $object, 'test2';
+    ok(17, ref($test{object}) eq 'test2', "reblessing works!");
+}