File: constant_codeinfo.t

package info (click to toggle)
libmoose-perl 2.2207-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,416 kB
  • sloc: perl: 21,345; ansic: 291; makefile: 10
file content (22 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (8)
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;