File: no-bareword.t

package info (click to toggle)
libdevel-declare-perl 0.006017-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-updates
  • size: 428 kB
  • ctags: 249
  • sloc: ansic: 752; perl: 608; makefile: 2
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;