my $source;
if ( @DEMOLISH_methods ) {
$source = 'sub {';
+ $source .= 'local ( $., $@, $!, $^E, $? );' . "\n";
my @DEMOLISH_calls;
foreach my $method (@DEMOLISH_methods) {
use strict;
use warnings;
-use Test::More tests => 7;
+use Test::More tests => 10;
use Test::Exception;
is( $@, 0, '$@ is still 0 after object is demolished' );
is( $?, 42, '$? is still 42 after object is demolished' );
is( $! + 0, 84, '$! is still 84 after object is demolished' );
+
+ Baz->meta->make_immutable, redo
+ if Baz->meta->is_mutable
}