From: Florian Ragwitz Date: Fri, 14 Nov 2008 21:04:42 +0000 (+0000) Subject: Add a failing testcase for get_all_package_symbols and inlined constants. X-Git-Tag: 0.70~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa3f5c84aa99aea642dba9401c2c9d2e033de806;p=gitmo%2FClass-MOP.git Add a failing testcase for get_all_package_symbols and inlined constants. --- diff --git a/t/304_constant_codeinfo.t b/t/304_constant_codeinfo.t new file mode 100644 index 0000000..3f907fa --- /dev/null +++ b/t/304_constant_codeinfo.t @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Test::More tests => 3; + +BEGIN { + use_ok('Class::MOP'); +} + +{ + package Foo; + use constant FOO => 'bar'; +} + +my $meta = Class::MOP::Class->initialize('Foo'); + +my %syms = $meta->get_all_package_symbols('CODE'); +is(ref $syms{FOO}, 'CODE', 'get constant symbol'); + +undef %syms; + +%syms = $meta->get_all_package_symbols('CODE'); +is(ref $syms{FOO}, 'CODE', 'constant symbol still there, although we dropped our reference');