File: padstuff.t

package info (click to toggle)
libdevel-declare-perl 0.006019-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 376 kB
  • ctags: 150
  • sloc: ansic: 752; perl: 608; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;
use Test::More 0.88;

sub action (&) { return shift; }

sub handle_action {
  return (undef, undef, 'my ($self, $c) = (shift, shift);');
}

use Devel::Declare;
use Devel::Declare action => [ DECLARE_NONE, \&handle_action ];

my $args;

my $a = action {
  $args = join(', ', $self, $c);
};

$a->("SELF", "CONTEXT");

is($args, "SELF, CONTEXT", "args passed ok");

done_testing;