From: Dave Rolsky Date: Mon, 23 Aug 2010 13:13:17 +0000 (-0500) Subject: Add a test for a constant with an undef value X-Git-Tag: 1.06~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=adb2de7dd5a101e6742d23dc70fa8990fdadf02c;p=gitmo%2FClass-MOP.git Add a test for a constant with an undef value --- diff --git a/t/003_methods.t b/t/003_methods.t index 53813db..418c9b8 100644 --- a/t/003_methods.t +++ b/t/003_methods.t @@ -355,9 +355,10 @@ is( $new_method->original_method, $method, { package HasConstants; - use constant FOO => 1; - use constant BAR => []; - use constant BAZ => {}; + use constant FOO => 1; + use constant BAR => []; + use constant BAZ => {}; + use constant UNDEF => undef; sub quux {1} sub thing {1} @@ -367,13 +368,13 @@ my $HC = Class::MOP::Class->initialize('HasConstants'); is_deeply( [ sort $HC->get_method_list ], - [qw( BAR BAZ FOO quux thing )], + [qw( BAR BAZ FOO UNDEF quux thing )], 'get_method_list handles constants properly' ); is_deeply( [ sort map { $_->name } $HC->_get_local_methods ], - [qw( BAR BAZ FOO quux thing )], + [qw( BAR BAZ FOO UNDEF quux thing )], '_get_local_methods handles constants properly' );