File: multiline-proto.t

package info (click to toggle)
libdevel-declare-perl 0.006000-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 296 kB
  • ctags: 238
  • sloc: perl: 1,605; ansic: 756; makefile: 25
file content (24 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (7)
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 tests => 1;

sub fun :lvalue { return my $sv; }

sub handle_fun {
  my ($usepack, $use, $inpack, $name, $proto) = @_;
  my $XX = sub (&) {
    my $cr = $_[0];
    return sub {
      return join(': ', $proto, $cr->());
    };
  };
  return (undef, $XX);
}

use Devel::Declare;
use Devel::Declare fun => [ DECLARE_PROTO, \&handle_fun ];

my $foo = fun ($a,
$b) { "woot" };

is($foo->(), "\$a,\n\$b: woot", 'proto declarator ok');