Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 35 lines (24 sloc) 0.83 kb
d007a44 [t] move multidimensional_arglists.t to spec/, and correct it according ...
moritz authored
1 use v6;
2
3 use Test;
4
5 plan7 ;
6
7 # L<S06/"Multidimensional argument list binding">
8
9 sub get_multidim_arglist (*@@AoA) { @@AoA }
10
11 {
12 my @array1 = <a b c>;
13 my @array2 = <d e f>;
14
15 my @@AoA = get_multidim_arglist(@array1; @array2);
16 is +@@AoA, 2, "basic multidim arglist binding (1)";
17 is ~@@AoA[0], "a b c", "basic multidim arglist binding (2)";
18 is ~@@AoA[1], "d e f", "basic multidim arglist binding (3)";
19 }
20
21 {
22 my @array1 = <a b c>;
23
24 my @@AoA = get_multidim_arglist(@array1);
25 is +@@AoA, 1, "multidim arglist binding with only one array (1)";
26 is ~@@AoA[0], "a b c", "multidim arglist binding with only one array (2)";
27 }
28
29 {
30 # XXX is this correct?
31 dies_ok { get_multidim_arglist(1,2,3) },
32 "three scalars are not compatible with a sub expecting a multidim arglist";
33 }
34
Something went wrong with that request. Please try again.