Skip to content

Commit d3aa62b

Browse files
committed
Add tests for RT #120973
1 parent d89ac19 commit d3aa62b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

S03-metaops/cross.t

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

33
use Test;
4-
plan 31;
4+
plan 34;
55

66
# L<S03/List infix precedence/the cross operator>
77
ok EVAL('<a b> X <c d>'), 'cross non-meta operator parses';
@@ -128,4 +128,19 @@ is (1,2 X ( <a b> X "x")).join, '1a1x1b1x2a2x2b2x',
128128
eval_dies_ok 'my %foo XX= 1', "cross doesn't handle assignment";
129129
}
130130

131+
# RT #120973
132+
{
133+
my @rt120973 = <a b> X <1 2>.map({$_});
134+
is @rt120973, <a 1 a 2 b 1 b 2>,
135+
'cross product with a .map in the rhs produces expected result';
136+
137+
@rt120973 = <a b>.map({$_}) X <1 2>;
138+
is @rt120973, <a 1 a 2 b 1 b 2>,
139+
'cross product with a .map in lhs produces expected result';
140+
141+
@rt120973 = <a b>.map({$_}) X <1 2>.map({$_});
142+
is @rt120973, <a 1 a 2 b 1 b 2>,
143+
'cross product with a .map in lhs and rhs produces expected result';
144+
}
145+
131146
# vim: ft=perl6

0 commit comments

Comments
 (0)