Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 40 lines (29 sloc) 0.839 kB
002a3d4 [spec] added test for sequential alternations (||) in regexes
moritz authored
1 use v6;
2 use Test;
3a1ce4c [spec] tests for interpolated sequential alternations ( ||@list )
moritz authored
3 plan 10;
002a3d4 [spec] added test for sequential alternations (||) in regexes
moritz authored
4
5 #L<S05/New metacharacters/"As with the disjunctions | and ||">
6
7 {
8 my $str = 'x' x 7;
9
10 ok $str ~~ m/x||xx||xxxx/;
11 is ~$/, 'x', 'first || alternative matches';
12 ok $str ~~ m/xx||x||xxxx/;
13 is ~$/, 'xx', 'first || alternative matches';
14 }
15
16 {
17 my $str = 'x' x 3;
18 ok $str ~~ m/xxxx||xx||x/;
19 is ~$/, 'xx', 'second alternative || matches if first fails';
20 }
3a1ce4c [spec] tests for interpolated sequential alternations ( ||@list )
moritz authored
21
22 #L<S05/"Variable (non-)interpolation"/"An interpolated array:">
23
24 {
25 my $str = 'x' x 7;
26 my @list = <x xx xxxx>;
27
28 ok $str ~~ m/ ||@list /;
0c6083f @FROGGS unfudged seq.-array tests
FROGGS authored
29 #?niecza todo 'sequential alternation NYI'
3a1ce4c [spec] tests for interpolated sequential alternations ( ||@list )
moritz authored
30 is ~$/, 'x', 'first ||@list alternative matches';
31
32 @list = <xx x xxxx>;
33
34 ok $str ~~ m/ ||@list /;
0c6083f @FROGGS unfudged seq.-array tests
FROGGS authored
35 #?niecza todo 'sequential alternation NYI'
3a1ce4c [spec] tests for interpolated sequential alternations ( ||@list )
moritz authored
36 is ~$/, 'xx', 'first ||@list alternative matches';
37 }
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
38
39 # vim: ft=perl6
Something went wrong with that request. Please try again.