Skip to content

Commit

Permalink
avoid passing objects we want to go away to Test::More::is
Browse files Browse the repository at this point in the history
Test::Simple 1.302178 to 1.302182 have a bug where when running under
Devel::Cover, objects passed to Test::More::is will be captured and held
until process end. When testing weakening, we expect an object to go
away. Avoid passing the object to 'is' to prevent it from ever being
captured.
  • Loading branch information
haarg committed Oct 21, 2020
1 parent 5831032 commit eac9ca1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/cmop/instance.t
Expand Up @@ -97,12 +97,12 @@ $mi_foo->set_slot_value( $i_foo, "moosen", $ref );
$mi_foo->weaken_slot_value( $i_foo, "moosen" );

ok( isweak($i_foo->{moosen}), '... white box test of weaken' );
is( $mi_foo->get_slot_value( $i_foo, "moosen" ), $ref, "weak value is fetchable" );
ok( ($mi_foo->get_slot_value( $i_foo, "moosen" ) || 0) == $ref, "weak value is fetchable" );
ok( !isweak($mi_foo->get_slot_value( $i_foo, "moosen" )), "return value not weak" );

undef $ref;

is( $mi_foo->get_slot_value( $i_foo, "moosen" ), undef, "weak value destroyed" );
ok( !defined $mi_foo->get_slot_value( $i_foo, "moosen" ), "weak value destroyed" );

$ref = [];

Expand Down

0 comments on commit eac9ca1

Please sign in to comment.