Skip to content

Commit

Permalink
test that Zop= and Xop= work
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Mar 6, 2014
1 parent ac4bb81 commit 5f9f92c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion S03-metaops/cross.t
@@ -1,7 +1,7 @@
use v6;

use Test;
plan 28;
plan 29;

# L<S03/List infix precedence/the cross operator>
ok EVAL('<a b> X <c d>'), 'cross non-meta operator parses';
Expand Down Expand Up @@ -111,4 +111,10 @@ is ([1,2] X~ <a b>), '1 2a 1 2b', '[] does not flatten';
is (1,2 X ( <a b> X "x")).join, '1a1x1b1x2a2x2b2x',
'Nested X works';

{
my @a = 1,2,3;
@a X*= 10;
is ~@a, '10 20 30', 'cross can modify containers on the left';
}

# vim: ft=perl6
8 changes: 7 additions & 1 deletion S03-metaops/zip.t
@@ -1,7 +1,7 @@
use v6;

use Test;
plan 24;
plan 25;

ok EVAL('<a b> Z <c d>'), 'zip non-meta operator parses';

Expand Down Expand Up @@ -72,4 +72,10 @@ isa_ok (1 Z 2)[0], Parcel, 'zip returns a list of parcels';
# RT #73948
is (1, 2 Z, 3, 4).join('|'), '1|3|2|4', 'Z, flattens in list context';

{
my @a = 1,2,3;
@a Z+= 3,2,1;
is ~@a, '4 4 4', 'zip can modify containers on the left'
}

# vim: ft=perl6

0 comments on commit 5f9f92c

Please sign in to comment.