4 use Test::More tests => 8;
7 use Class::MOP::Instance;
9 my $C = 'Class::MOP::Instance';
12 my $instance = '$self';
13 my $slot_name = 'foo';
17 is($C->inline_create_instance($class),
19 '... got the right code for create_instance');
20 is($C->inline_get_slot_value($instance, $slot_name),
22 '... got the right code for get_slot_value');
24 is($C->inline_set_slot_value($instance, $slot_name, $value),
25 "\$self->{'foo'} = \$value",
26 '... got the right code for set_slot_value');
28 is($C->inline_initialize_slot($instance, $slot_name),
30 '... got the right code for initialize_slot');
32 is($C->inline_is_slot_initialized($instance, $slot_name),
33 "exists \$self->{'foo'}",
34 '... got the right code for get_slot_value');
36 is($C->inline_weaken_slot_value($instance, $slot_name),
37 "Scalar::Util::weaken( \$self->{'foo'} )",
38 '... got the right code for weaken_slot_value');
40 is($C->inline_strengthen_slot_value($instance, $slot_name),
41 "\$self->{'foo'} = \$self->{'foo'}",
42 '... got the right code for strengthen_slot_value');
43 is($C->inline_rebless_instance_structure($instance, $class),
44 "bless \$self => \$class",
45 '... got the right code for rebless_instance_structure');