Skip to content
Newer
Older
100644 38 lines (30 sloc) 813 Bytes
5309a5f [t/spec] add tests for RT #60404
moritz authored Nov 25, 2008
1 use v6;
2 use Test;
785f27d [t/spec] more unfudging, and add tests to passing-arrays.t
moritz authored Dec 9, 2008
3 plan 7;
5309a5f [t/spec] add tests for RT #60404
moritz authored Nov 25, 2008
4
5 {
6 sub count(@a) {
7 my $x = 0;
8 $x++ for @a;
9 return $x;
10 }
11
12 is count([1, 2, 3, 4]), 1, 'count([1, 2, 3, 4])';
13 is count(my @b = 1, 2, 3, 4), 4, 'count(my @b = 1, 2, 3)';
1216c98 [t/spec] Another test for passing with lists/scalar interaction that …
jnthn authored Nov 27, 2008
14 is count((1, 2, 3)), 3, 'count((1, 2, 3))';
15
16 sub count2($a) {
17 my $x = 0;
18 $x++ for $a;
19 return $x;
20 }
21
22 #?rakudo skip "not handling scalars being passed lists correctly"
23 is count2((1,2,3)), 1, 'count2((1,2,3))';
5309a5f [t/spec] add tests for RT #60404
moritz authored Nov 25, 2008
24 }
25
785f27d [t/spec] more unfudging, and add tests to passing-arrays.t
moritz authored Dec 9, 2008
26 {
27 sub pa(@a) { @a.WHAT; }
28 my @b = 2, 3;
29 is pa(@b), 'Array', 'basic array type sanity';
30 #?rakudo todo 'RT #61172'
31 dies_ok { pa(3) }, 'non-slurpy array does not take a single Int';
32
33 sub ph(%h) { 1 }
34 #?rakudo todo 'RT #61172'
35 dies_ok { ph(3) }, 'an Int is not a Hash';
36
37 }
Something went wrong with that request. Please try again.