[Bast-commits] r4937 - Devel-Declare/1.000/trunk/t

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Sun Oct 19 05:30:24 BST 2008


Author: rafl
Date: 2008-10-19 05:30:23 +0100 (Sun, 19 Oct 2008)
New Revision: 4937

Added:
   Devel-Declare/1.000/trunk/t/multiline-proto.t
Log:
Add a multiline proto test in an extra file.

Added: Devel-Declare/1.000/trunk/t/multiline-proto.t
===================================================================
--- Devel-Declare/1.000/trunk/t/multiline-proto.t	                        (rev 0)
+++ Devel-Declare/1.000/trunk/t/multiline-proto.t	2008-10-19 04:30:23 UTC (rev 4937)
@@ -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');




More information about the Bast-commits mailing list