From: Florian Ragwitz Date: Sun, 19 Oct 2008 04:30:23 +0000 (+0000) Subject: Add a multiline proto test in an extra file. X-Git-Tag: 0.005000~64 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-Declare.git;a=commitdiff_plain;h=7e30ce83b281f112233e5a03e72082986e4148dd Add a multiline proto test in an extra file. --- diff --git a/t/multiline-proto.t b/t/multiline-proto.t new file mode 100644 index 0000000..b549313 --- /dev/null +++ b/t/multiline-proto.t @@ -0,0 +1,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, $b: woot', 'proto declarator ok');