File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ built-in grep tests
9
9
10
10
= end pod
11
11
12
- plan 44 ;
12
+ plan 45 ;
13
13
14
14
my @ list = (1 .. 10 );
15
15
@@ -167,4 +167,17 @@ my @list = (1 .. 10);
167
167
);
168
168
}
169
169
170
+ # https://irclog.perlgeek.de/perl6/2018-03-04#i_15882545
171
+ subtest ' .grep(Regex) on hyper/race Seq do not crash' => {
172
+ plan 4 ;
173
+ is-deeply " a\n b\n c\n bo\n " . lines . race . grep (/b /). List , <b bo >, ' race basic' ;
174
+ is-deeply " a\n b\n c\n bo\n " . lines . hyper . grep (/b /). List , <b bo >, ' hyper basic' ;
175
+
176
+ my @ has := (^ 10_000 ). eager ;
177
+ my @ wanted := @ has . grep (*. contains : ' 2' ). List ;
178
+ my $ w = ' 2' ;
179
+ is-deeply @ has . race . grep ( /$ w /). List , @ wanted , ' race, with shared var' ;
180
+ is-deeply @ has . hyper . grep (/$ w /). List , @ wanted , ' hyper, with shared var' ;
181
+ }
182
+
170
183
# vim: ft=perl6
You can’t perform that action at this time.
0 commit comments