Commit | Line | Data |
---|---|---|
53e3ab32 | 1 | use strict; |
2 | use warnings; | |
3 | use Test::More 'no_plan'; | |
4 | ||
5 | sub action (&) { return shift; } | |
6 | ||
7 | sub handle_action { | |
8 | return (undef, undef, 'my ($self, $c) = (shift, shift);'); | |
9 | } | |
10 | ||
11 | use Devel::Declare; | |
12 | use Devel::Declare action => [ DECLARE_NONE, \&handle_action ]; | |
13 | ||
14 | my $args; | |
15 | ||
16 | my $a = action { | |
17 | $args = join(', ', $self, $c); | |
18 | }; | |
19 | ||
20 | $a->("SELF", "CONTEXT"); | |
21 | ||
22 | is($args, "SELF, CONTEXT", "args passed ok"); |