4 use Test::More tests => 15;
14 push @called, 'Class::DEMOLISH';
19 # push @called, 'Class::DEMOLISHALL';
20 # $self->SUPER::DEMOLISHALL(@_);
28 push @called, 'Child::DEMOLISH';
33 # push @called, 'Child::DEMOLISHALL';
34 # $self->SUPER::DEMOLISHALL(@_);
38 is_deeply([splice @called], [], "no DEMOLISH calls yet");
41 ok(Class->meta, Class->meta->is_immutable ? 'mutable' : 'immutable');
44 my $object = Class->new;
46 is_deeply([splice @called], [], "no DEMOLISH calls yet");
49 is_deeply([splice @called], ['Class::DEMOLISH']);
52 my $child = Child->new;
53 is_deeply([splice @called], [], "no DEMOLISH calls yet");
57 is_deeply([splice @called], ['Child::DEMOLISH', 'Class::DEMOLISH']);
60 my $child = Child->new;
61 $child->DEMOLISHALL();
63 is_deeply([splice @called], ['Child::DEMOLISH', 'Class::DEMOLISH'], 'DEMOLISHALL');
66 is_deeply([splice @called], ['Child::DEMOLISH', 'Class::DEMOLISH'], 'DEMOLISHALL');