import all tests from Fun
[p5sagit/Function-Parameters.git] / t / foreign / Fun / anon.t
diff --git a/t/foreign/Fun/anon.t b/t/foreign/Fun/anon.t
new file mode 100644 (file)
index 0000000..3acb7c0
--- /dev/null
@@ -0,0 +1,16 @@
+#!perl
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+
+use Function::Parameters;
+
+my $fun = fun ($x, $y) { $x * $y };
+
+is($fun->(3, 4), 12);
+
+my $fun2 = fun ($z, $w = 10) { $z / $w };
+
+is($fun2->(60), 6);
+
+done_testing;