use strict;
use warnings;
-use Test::More 'no_plan';
+use Test::More tests => 39;
use Test::Exception;
use Scalar::Util qw/isweak reftype/;
bless_instance_structure
get_all_slots
+
+ initialize_all_slots
get_slot_value
set_slot_value
initialize_slot
- initialize_all_slots
is_slot_initialized
+ weaken_slot_value
+ strengthen_slot_value
+
+ inline_get_slot_value
+ inline_set_slot_value
+ inline_initialize_slot
+ inline_is_slot_initialized
+ inline_weaken_slot_value
+ inline_strengthen_slot_value
/;
{
$mi_foo->set_slot_value( $i_foo, "moosen", "the value" );
is($mi_foo->get_slot_value( $i_foo, "moosen" ), "the value", "... get slot value");
-
ok(!$i_foo->can('moosen'), '... Foo cant moosen');
-can_ok( $mi_foo, "set_slot_value_weak" );
-
my $ref = [];
-$mi_foo->set_slot_value_weak( $i_foo, "moosen", $ref );
-is( $mi_foo->get_slot_value( $i_foo, "moosen" ), $ref, "weak value is fetchable" );
+$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( !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" );
-
$ref = [];
$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' );
$mi_foo->strengthen_slot_value( $i_foo, "moosen" );
+ok( !isweak($i_foo->{moosen}), '... white box test of weaken' );
undef $ref;
is( reftype( $mi_foo->get_slot_value( $i_foo, "moosen" ) ), "ARRAY", "weak value can be strengthened" );
-