Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (40 sloc) 0.869 kb
3766e25 [t] moved some closure_traits/* tests to spec/, some small simplificatio...
moritz authored
1 use v6;
2
3 use Test;
4
5 plan 4;
6
4e5f604 [t/spec] fix some smartlinks
moritz authored
7 # L<S04/Phasers/FIRST "at loop initialization time">
3766e25 [t] moved some closure_traits/* tests to spec/, some small simplificatio...
moritz authored
8 {
9 my $str = '';
10 for 1..2 {
11 FIRST { $str ~= $_ }
12 }
13 is $str, 1, 'FIRST only ran once';
14 }
15
16 {
17 my ($a, $a_in_first);
18 for 1..2 {
19 $a++;
20 FIRST { $a_in_first = $a }
21 }
2544bcf @jdhore Remove most remaining .notdef's.
jdhore authored
22 nok $a_in_first.defined, 'FIRST {} ran before the loop body';
3766e25 [t] moved some closure_traits/* tests to spec/, some small simplificatio...
moritz authored
23 }
24
4e5f604 [t/spec] fix some smartlinks
moritz authored
25 # L<S04/Phasers/can occur multiple times>
3766e25 [t] moved some closure_traits/* tests to spec/, some small simplificatio...
moritz authored
26 {
27 my $str = '';
28 for 1..2 {
29 FIRST { $str ~= $_ }
30 FIRST { $str ~= ':' }
31 FIRST { $str ~= ' ' }
32 }
33 is $str, '1: ', 'multiple FIRST {} ran in order';
34 }
35
4e5f604 [t/spec] fix some smartlinks
moritz authored
36 # L<S04/Phasers/FIRST "at loop initialization time" "before any ENTER">
3766e25 [t] moved some closure_traits/* tests to spec/, some small simplificatio...
moritz authored
37 {
38 my $str = '';
39 for 1..2 {
40 FIRST { $str ~= 'f1' }
41 ENTER { $str ~= 'e' }
42 FIRST { $str ~= 'f2' }
43 }
44 is $str, 'f1f2ee', 'FIRST {} ran before ENTER {}';
45 }
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
46
47 # vim: ft=perl6
Something went wrong with that request. Please try again.