import some (modified) MS tests
[p5sagit/Function-Parameters.git] / t / foreign / Method-Signatures / array_param.t
CommitLineData
633048d5 1#!perl
2use strict;
3use warnings FATAL => 'all';
4
5use 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
31is(Bla->new->array_param_at_end(1, 2, 3, 4), "1|2|3 4", "Array parameter at end");