2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
11 has foo => (is => 'ro');
18 has bar => (is => 'ro');
22 my $foo = Foo::Sub->new(foo => 12, bar => 25);
23 is($foo->foo, 12, 'got right value for foo');
24 is($foo->bar, 25, 'got right value for bar');
27 Foo->meta->make_immutable;
33 has baz => (is => 'ro');
34 # not making immutable, inheriting Foo's inlined constructor
38 my $foo = Foo::Sub2->new(foo => 42, baz => 27);
39 is($foo->foo, 42, 'got right value for foo');
40 is($foo->baz, 27, 'got right value for baz');
53 sub DEMOLISH { $BAR++ }
57 is($BAR, 1, 'DEMOLISH in subclass was called');
60 Bar->meta->make_immutable;
66 sub DEMOLISH { $BAR++ }
67 # not making immutable, inheriting Bar's inlined destructor
71 is($BAR, 1, 'DEMOLISH in subclass was called');