Commit | Line | Data |
514bcaa6 |
1 | #!perl |
2 | use strict; |
3 | use warnings FATAL => 'all'; |
4 | use Test::More tests => 5; |
5 | |
6 | use Function::Parameters; |
7 | |
8 | fun foo ($bar) { $bar } |
9 | |
10 | fun korv ($wurst, $_unused, $birne) { |
11 | return "${wurst}-${birne}"; |
12 | } |
13 | |
14 | fun array ($scalar, @array) { |
15 | return $scalar + @array; |
16 | } |
17 | |
18 | fun hash (%hash) { |
19 | return keys %hash; |
20 | } |
21 | |
22 | fun Name::space ($moo) { $moo } |
23 | |
24 | is(foo('baz'), 'baz'); |
25 | is(korv(qw/a b c/), 'a-c'); |
26 | is(array(10, 1..10), 20); |
27 | is_deeply( |
28 | [sort(hash(foo => 1, bar => 2))], |
29 | [sort(qw/foo bar/)], |
30 | ); |
31 | |
32 | is(Name::space('kooh'), 'kooh'); |