Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 69 lines (57 sloc) 1.116 kb
58135b30 »
2008-05-08 [t/spec] changed 'use v6-alpha;' to 'use v6;'
1 use v6;
ba90e175 »
2008-01-03 Tests for while and until loops
2
3 use Test;
4
5 plan 10;
6
7 {
983f107f »
2008-01-27 [rakudo] while/until statements now parse
8 my $i = 0;
9 while $i < 5 { $i++; };
10 is($i, 5, 'while $i < 5 {} works');
ba90e175 »
2008-01-03 Tests for while and until loops
11 }
983f107f »
2008-01-27 [rakudo] while/until statements now parse
12
ba90e175 »
2008-01-03 Tests for while and until loops
13 {
983f107f »
2008-01-27 [rakudo] while/until statements now parse
14 my $i = 0;
15 while 5 > $i { $i++; };
16 is($i, 5, 'while 5 > $i {} works');
ba90e175 »
2008-01-03 Tests for while and until loops
17 }
983f107f »
2008-01-27 [rakudo] while/until statements now parse
18
ba90e175 »
2008-01-03 Tests for while and until loops
19 # with parens
20 {
983f107f »
2008-01-27 [rakudo] while/until statements now parse
21 my $i = 0;
22 while ($i < 5) { $i++; };
23 is($i, 5, 'while ($i < 5) {} works');
ba90e175 »
2008-01-03 Tests for while and until loops
24 }
983f107f »
2008-01-27 [rakudo] while/until statements now parse
25
ba90e175 »
2008-01-03 Tests for while and until loops
26 {
983f107f »
2008-01-27 [rakudo] while/until statements now parse
27 my $i = 0;
28 while (5 > $i) { $i++; };
29 is($i, 5, 'while (5 > $i) {} works');
ba90e175 »
2008-01-03 Tests for while and until loops
30 }
31
32 # single value
33 {
983f107f »
2008-01-27 [rakudo] while/until statements now parse
34 my $j = 0;
35 while 0 { $j++; };
36 is($j, 0, 'while 0 {...} works');
ba90e175 »
2008-01-03 Tests for while and until loops
37 }
983f107f »
2008-01-27 [rakudo] while/until statements now parse
38
ba90e175 »
2008-01-03 Tests for while and until loops
39 {
983f107f »
2008-01-27 [rakudo] while/until statements now parse
40 my $k = 0;
41 while $k { $k++; };
42 is($k, 0, 'while $var {...} works');
ba90e175 »
2008-01-03 Tests for while and until loops
43 }
44
983f107f »
2008-01-27 [rakudo] while/until statements now parse
45
f60ff61d »
2008-01-23 [fudge] more sub counting tweaks
46 #?rakudo skip 'No pointy blocks on while loops yet'
ba90e175 »
2008-01-03 Tests for while and until loops
47 # L<S04/The C<for> statement/It is also possible to write>
48 # while ... -> $x {...}
49 {
50 my @array = 1..5;
51 my $str;
52 while @array.pop -> $x {
53 $str ~= $x;
54 }
55 is $!, undef, 'eval worked';
56 is $str, '54321', 'while ... -> $x {...} worked (1)';
57 }
58
f60ff61d »
2008-01-23 [fudge] more sub counting tweaks
59 #?rakudo skip 'No pointy blocks on while loops yet'
ba90e175 »
2008-01-03 Tests for while and until loops
60 {
61 my @array = 0..5;
62 my $str;
63 while pop @array -> $x {
64 $str ~= $x;
65 }
a2ddaeb3 »
2008-01-16 more "fudge normal form"
66 is $!, undef, 'eval worked';
ba90e175 »
2008-01-03 Tests for while and until loops
67 is $str, '54321', 'while ... -> $x {...} worked (2)';
68 }
Something went wrong with that request. Please try again.