Don't mortalize the CVs behind inlined constants in the xs version of get_all_package...
[gitmo/Class-MOP.git] / t / 304_constant_codeinfo.t
CommitLineData
fa3f5c84 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use Test::More tests => 3;
6
7BEGIN {
8 use_ok('Class::MOP');
9}
10
11{
12 package Foo;
13 use constant FOO => 'bar';
14}
15
16my $meta = Class::MOP::Class->initialize('Foo');
17
18my %syms = $meta->get_all_package_symbols('CODE');
19is(ref $syms{FOO}, 'CODE', 'get constant symbol');
20
21undef %syms;
22
23%syms = $meta->get_all_package_symbols('CODE');
24is(ref $syms{FOO}, 'CODE', 'constant symbol still there, although we dropped our reference');