Skip to content

Commit f004942

Browse files
committed
Test Iterable.flat propagates .is-lazy
Note that routine &flat does not propagate it and based on the source comments[^1], it appears it wasn't meant to. [1] https://github.com/rakudo/rakudo/blob/51b0aba/src/core/List.pm#L1377-L1382
1 parent 629a459 commit f004942

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

S02-types/array.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 102;
5+
plan 103;
66

77
#L<S02/Mutable types/Array>
88

@@ -391,4 +391,11 @@ my @array2 = ("test", 1, Mu);
391391
cmp-ok $x.flat, '===', $x, 'Array:U.flat is identity';
392392
}
393393

394+
# https://github.com/rakudo/rakudo/commit/51b0aba8e8
395+
subtest '.flat propagates .is-lazy' => {
396+
plan 2;
397+
is-deeply (42 xx *).flat.is-lazy, True, 'method, True';
398+
is-deeply (42 xx 1).flat.is-lazy, False, 'method, False';
399+
}
400+
394401
# vim: ft=perl6

0 commit comments

Comments
 (0)