projects
/
gitmo/Eval-Closure.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
changelog
[gitmo/Eval-Closure.git]
/
t
/
lexical-subs.t
1
#!/usr/bin/env perl
2
use strict;
3
use warnings;
4
use Test::More;
5
6
use Test::Requires '5.018';
7
use 5.018;
8
9
use Eval::Closure;
10
11
my $sub = eval_closure(
12
source => 'sub { foo() }',
13
environment => {
14
'&foo' => sub { state $i++ },
15
}
16
);
17
18
is($sub->(), 0);
19
is($sub->(), 1);
20
is($sub->(), 2);
21
22
done_testing;