4 use Test::More tests => 6;
7 use Class::MOP::Instance;
9 my $C = 'Class::MOP::Instance';
12 my $instance = '$self';
13 my $slot_name = 'foo';
16 is($C->inline_get_slot_value($instance, $slot_name),
18 '... got the right code for get_slot_value');
20 is($C->inline_set_slot_value($instance, $slot_name, $value),
21 '$self->{"foo"} = $value',
22 '... got the right code for set_slot_value');
24 is($C->inline_initialize_slot($instance, $slot_name),
26 '... got the right code for initialize_slot');
28 is($C->inline_is_slot_initialized($instance, $slot_name),
29 'exists $self->{"foo"}',
30 '... got the right code for get_slot_value');
32 is($C->inline_weaken_slot_value($instance, $slot_name),
33 'Scalar::Util::weaken( $self->{"foo"} )',
34 '... got the right code for weaken_slot_value');
36 is($C->inline_strengthen_slot_value($instance, $slot_name),
37 '$self->{"foo"} = $self->{"foo"}',
38 '... got the right code for strengthen_slot_value');