Commit | Line | Data |
---|---|---|
2424de2d | 1 | use strict; |
2 | use warnings; | |
faaf0544 | 3 | use Test::More 0.88; |
2424de2d | 4 | |
5 | our $i; | |
6 | BEGIN { $i = 0 }; | |
7 | ||
8 | sub method { } | |
9 | BEGIN { | |
10 | require Devel::Declare; | |
11 | Devel::Declare->setup_for( | |
12 | __PACKAGE__, | |
13 | { "method" => { const => sub { $i++ } } }, | |
14 | ); | |
15 | } | |
16 | ||
17 | { | |
18 | package Foo; | |
19 | sub method { } | |
20 | } | |
21 | ||
22 | Foo->method; | |
23 | BEGIN { is($i, 0) } | |
24 | ||
f7acf3b0 | 25 | my @foo = ( |
26 | method | |
27 | => | |
28 | 123 | |
29 | ); | |
358aacb2 | 30 | BEGIN { is($i, 0) } |
2424de2d | 31 | |
8781bcf2 | 32 | is_deeply(\@foo, ['method', '123']); |
33 | ||
2424de2d | 34 | done_testing; |