summaryrefslogtreecommitdiffstats
path: root/t/fun/slurpy.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-21 16:50:34 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-21 16:50:34 -0400
commit597610ad1c915a5b004148fdb3151b0cec976790 (patch)
tree9e3e002a3b536ea943d73b51c8318d08f3f6ecb9 /t/fun/slurpy.t
parent336e491e532144d1c8a6e367409149e8d084fa1d (diff)
downloadparse-keyword-597610ad1c915a5b004148fdb3151b0cec976790.tar.gz
parse-keyword-597610ad1c915a5b004148fdb3151b0cec976790.zip
add tests for Fun
Diffstat (limited to 't/fun/slurpy.t')
-rw-r--r--t/fun/slurpy.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/fun/slurpy.t b/t/fun/slurpy.t
new file mode 100644
index 0000000..42a7f10
--- /dev/null
+++ b/t/fun/slurpy.t
@@ -0,0 +1,20 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use lib 't/fun/lib';
+
+use Fun;
+
+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;