summaryrefslogtreecommitdiff
path: root/t/cmop/constant_codeinfo.t
blob: b40cc82b26281f596e3ae0bfef26c27f9a50eb12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
use Test::More;

use 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');

done_testing;