Commit | Line | Data |
633048d5 |
1 | #!perl |
2 | use strict; |
3 | use warnings FATAL => 'all'; |
4 | |
5 | use Test::More tests => 3; |
6 | |
7 | { |
8 | package Bla; |
9 | use Test::More; |
10 | use Function::Parameters qw(:strict); |
11 | |
12 | method new ($class:) { |
13 | bless {}, $class; |
14 | } |
15 | |
16 | method array_param_at_end ($a, $b, @c) { |
17 | return "$a|$b|@c"; |
18 | } |
19 | |
20 | eval q{ |
21 | method two_array_params ($a, @b, @c) {} |
22 | }; |
23 | like($@, qr{\btwo_array_params\b.+\@b\b.+\@c\b}, "Two array params"); |
24 | |
25 | eval q{ |
26 | method two_slurpy_params ($a, %b, $c, @d, $e) {} |
27 | }; |
28 | like($@, qr{\btwo_slurpy_params\b.+%b\b.+\$c\b}, "Two slurpy params"); |
29 | } |
30 | |
31 | is(Bla->new->array_param_at_end(1, 2, 3, 4), "1|2|3 4", "Array parameter at end"); |