Merge branch 'metadata' into mooseish-types
[p5sagit/Function-Parameters.git] / t / foreign / Fun / slurpy.t
diff --git a/t/foreign/Fun/slurpy.t b/t/foreign/Fun/slurpy.t
new file mode 100644 (file)
index 0000000..50d66c8
--- /dev/null
@@ -0,0 +1,19 @@
+#!perl
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+
+use Function::Parameters;
+
+fun test_array ( $foo, @bar ) {
+    return [ $foo, @bar ];
+}
+
+fun test_hash ( $foo, %bar ) {
+    return { foo => $foo, %bar };
+}
+
+is_deeply( test_array( 1, 2 .. 10 ), [ 1, 2 .. 10 ], '... slurpy array worked' );
+is_deeply( test_hash( 1, ( two => 2, three => 3 ) ), { foo => 1, two => 2, three => 3 }, '... slurpy hash worked' );
+
+done_testing;