Skip to content

Commit 62532fb

Browse files
committed
Spec smartmatch with lazy iterables
Rakudo fix: rakudo/rakudo@1b9638e2b5
1 parent 1287ea5 commit 62532fb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

S03-smartmatch/array-array.t

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 68;
3+
plan 69;
44

55
#L<S03/Smart matching/arrays are comparable>
66
{
@@ -93,4 +93,14 @@ plan 68;
9393
eval-lives-ok '[1,2,3] ~~ [**, "b", "c"]', "Str and Whatever (2)";
9494
}
9595

96+
subtest '~~ with lazy iterables never throws' => {
97+
plan 4;
98+
is-deeply [1...*] ~~ (1...*), False, 'lazy ~~ lazy is False';
99+
is-deeply [1, 2 ] ~~ [1...*], False, 'non-lazy ~~ lazy is False';
100+
is-deeply [1...*] ~~ [1, 2 ], False, 'lazy ~~ non-lazy is False';
101+
102+
my $iter := [1...*];
103+
is-deeply $iter ~~ $iter, True, 'lazy ~~ lazy is True when same object';
104+
}
105+
96106
# vim: ft=perl6

0 commit comments

Comments
 (0)