File: no-bareword.t

package info (click to toggle)
libdevel-declare-perl 0.006000-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 296 kB
  • ctags: 238
  • sloc: perl: 1,605; ansic: 756; makefile: 25
file content (34 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;
use warnings;
use Test::More;

our $i;
BEGIN { $i = 0 };

sub method { }
BEGIN {
        require Devel::Declare;
        Devel::Declare->setup_for(
                __PACKAGE__,
                { "method" => { const => sub { $i++ } } },
        );
}

{
    package Foo;
    sub method { }
}

Foo->method;
BEGIN { is($i, 0) }

my @foo = (
    method
    =>
    123
);
BEGIN { is($i, 0) }

is_deeply(\@foo, ['method', '123']);

done_testing;