4 use constant HAS_THREADS => eval{ require threads };
6 use Test::More HAS_THREADS ? (tests => 6) : (skip_all => "This is a test for threads ($@)");
25 my $o = MyClass->new(foo => Foo->new(value => 42));
27 my $x = MyClass->new(foo => Foo->new(value => 1));
30 $x->foo(Foo->new(value => 2));
34 MyClass->meta->make_immutable();
36 $x = MyClass->new(foo => Foo->new(value => 10));
37 is $x->foo->value, 10;
39 $x->foo(Foo->new(value => 20));
41 is $x->foo->value, 20;
44 is $o->foo->value, 42;
45 ok !$o->meta->is_immutable;