Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix cross metaop with nested/itemized lists
  • Loading branch information
vendethiel committed Aug 28, 2015
1 parent c4385c4 commit 5e7d42f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions S03-metaops/cross.t
Expand Up @@ -20,7 +20,7 @@ is ([+] 1, 2, 3 X** 2, 4), (1+1 + 4+16 + 9+81), '[+] and X** work';
# L<S03/List infix precedence/This becomes a flat list in>
{
my @result = gather {
for @(1..3 X 'a'..'b') -> $n, $a {
for 1..3 X 'a'..'b' -> ($n, $a) {
take "$n|$a"
}
}
Expand Down Expand Up @@ -50,7 +50,7 @@ ok EVAL('<a b> X, <c d>'), 'cross metaoperator parses';
# L<S03/Cross operators/list concatenating form when used like this>
{
my @result = <a b> X, 1,2 X, <x y>;
is @result.elems, 24, 'chained cross-comma produces correct number of elements';
is @result.elems, 8, 'chained cross-comma produces correct number of elements';

my @expected = (
['a', 1, 'x'],
Expand Down Expand Up @@ -105,9 +105,9 @@ is (<a b> X <c d> X < e f>).flat.join(','),
'cross works with three lists';

#?niecza todo
is ([1,2] X~ <a b>), '1 2a 1 2b', '[] does not flatten';
is ($[1,2] X~ <a b>), '1 2a 1 2b', '$[] does not flatten';

is (1,2 X ( <a b> X "x")).flat.join, '1a1x1b1x2a2x2b2x',
is (1,2 X (<a b> X "x")).flat.join, '1ax1bx2ax2bx',
'Nested X works';

# RT #77660
Expand Down

0 comments on commit 5e7d42f

Please sign in to comment.