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;
22 # Defining this causes the FIRST call to Baz->new w/o param to fail,
23 # if no call to ANY Mouse::Object->new was done before.
26 # ... Mouse (kinda) eats exceptions in DESTROY/DEMOLISH";
31 my $obj = eval { Foo->new; };
32 like( $@, qr/is required/, "... Foo plain" );
33 is( $obj, undef, "... the object is undef" );
39 sub new { die "Bar died"; }
42 die "Vanilla Perl eats exceptions in DESTROY too";
47 my $obj = eval { Bar->new; };
48 like( $@, qr/Bar died/, "... Bar plain" );
49 is( $obj, undef, "... the object is undef" );
69 is( $@, 42, '$@ is still 42 after object is demolished without dying' );
70 is( $?, 84, '$? is still 84 after object is demolished without dying' );
78 is( $@, 0, '$@ is still 0 after object is demolished without dying' );
80 Baz->meta->make_immutable, redo
81 if Baz->meta->is_mutable