From: Yuval Kogman Date: Wed, 18 Jun 2008 09:40:38 +0000 (+0000) Subject: test for 5.10 case of borked constanting X-Git-Tag: 0_64~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e275e8685f99a57a66b8eae4c48cf1cbddaf631;p=gitmo%2FClass-MOP.git test for 5.10 case of borked constanting --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index d127aec..d01d223 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -172,6 +172,7 @@ sub is_class_loaded { my $glob = ${$$pack}{$_} || next; + # constant subs if ( IS_RUNNING_ON_5_10 ) { return 1 if ref $glob eq 'SCALAR'; } diff --git a/t/083_load_class.t b/t/083_load_class.t index 561c15f..c6f816a 100644 --- a/t/083_load_class.t +++ b/t/083_load_class.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 11; +use Test::More tests => 13; use Test::Exception; require Class::MOP; @@ -33,3 +33,9 @@ throws_ok { Class::MOP::load_class('SyntaxError'); } qr/Missing right curly/; +{ + package Other; + use constant foo => "bar"; +} + +lives_ok { ok(Class::MOP::is_class_loaded("Other")) } "a class with just constants is still a class";