X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F061_instance_inline.t;h=1679245aa6d6fd2923d8aaad9d4457411d7c6859;hb=cb75020f6a75898378d873583561654f3519ea92;hp=ec353025426a745f32f760f69e3ed0cec3ad6780;hpb=8d2d4c6705a3781606464d003a3641d835a35815;p=gitmo%2FClass-MOP.git diff --git a/t/061_instance_inline.t b/t/061_instance_inline.t index ec35302..1679245 100644 --- a/t/061_instance_inline.t +++ b/t/061_instance_inline.t @@ -18,7 +18,7 @@ my $C = 'Class::MOP::Instance'; my $value = '$value'; is($C->inline_get_slot_value($instance, $slot_name), - 'exists $self->{"foo"} ? $self->{"foo"} : undef', + '$self->{"foo"}', '... got the right code for get_slot_value'); is($C->inline_set_slot_value($instance, $slot_name, $value), @@ -26,11 +26,11 @@ my $C = 'Class::MOP::Instance'; '... got the right code for set_slot_value'); is($C->inline_initialize_slot($instance, $slot_name), - '$self->{"foo"} = undef', + '', '... got the right code for initialize_slot'); is($C->inline_is_slot_initialized($instance, $slot_name), - 'exists $self->{"foo"} ? 1 : 0', + 'exists $self->{"foo"}', '... got the right code for get_slot_value'); is($C->inline_weaken_slot_value($instance, $slot_name), @@ -48,7 +48,7 @@ my $C = 'Class::MOP::Instance'; my $value = '[]'; is($C->inline_get_slot_value($instance, $slot_name), - 'exists $_[0]->{$attr_name} ? $_[0]->{$attr_name} : undef', + '$_[0]->{$attr_name}', '... got the right code for get_slot_value'); is($C->inline_set_slot_value($instance, $slot_name, $value), @@ -56,11 +56,11 @@ my $C = 'Class::MOP::Instance'; '... got the right code for set_slot_value'); is($C->inline_initialize_slot($instance, $slot_name), - '$_[0]->{$attr_name} = undef', + '', '... got the right code for initialize_slot'); is($C->inline_is_slot_initialized($instance, $slot_name), - 'exists $_[0]->{$attr_name} ? 1 : 0', + 'exists $_[0]->{$attr_name}', '... got the right code for get_slot_value'); is($C->inline_weaken_slot_value($instance, $slot_name), @@ -81,7 +81,7 @@ my $accessor_string = "sub {\n" is($accessor_string, q|sub { $_[0]->{$attr_name} = $_[1] if scalar @_ == 2; -exists $_[0]->{$attr_name} ? $_[0]->{$attr_name} : undef; +$_[0]->{$attr_name}; }|, '... got the right code string for accessor'); @@ -91,7 +91,7 @@ my $reader_string = "sub {\n" is($reader_string, q|sub { -exists $_[0]->{$attr_name} ? $_[0]->{$attr_name} : undef; +$_[0]->{$attr_name}; }|, '... got the right code string for reader');