Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make sure . doesn't try to work with metaops
  • Loading branch information
TimToady committed Oct 2, 2015
1 parent 2d49591 commit 647e449
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
5 changes: 4 additions & 1 deletion S03-metaops/cross.t
@@ -1,7 +1,7 @@
use v6;

use Test;
plan 48;
plan 50;

# L<S03/List infix precedence/the cross operator>
ok EVAL('<a b> X <c d>'), 'cross non-meta operator parses';
Expand Down Expand Up @@ -165,4 +165,7 @@ is (1,2 X (<a b> X "x")).flat.join, '1ax1bx2ax2bx',
ok !(42 X* 1..5 X* 43).is-lazy, "laziness not induced by middle argument (X*)";
}

throws-like '3 X. foo', X::Syntax::CannotMeta, "X. is too fiddly";
throws-like '3 X. "foo"', X::Obsolete, "X. can't do P5 concat";

# vim: ft=perl6
4 changes: 3 additions & 1 deletion S03-metaops/hyper.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 318;
plan 319;

=begin pod
Expand Down Expand Up @@ -917,4 +917,6 @@ is ((1, 2) >>[+]<< (100, 200)).join(','), '101,202',
"non-dwim hyper against empty RHS dies";
}

throws-like '3 «.» foo', X::Obsolete, "«.» can't be hypered";

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

plan 39;
plan 41;

=begin pod
Expand Down Expand Up @@ -62,4 +62,7 @@ nok False !|| True, '!|| is legal and works (2)';
ok True !^^ True, '!^^ is legal and works (1)';
nok False !^^ True, '!^^ is legal and works (2)';

throws-like '3 !. foo', X::Syntax::CannotMeta, "!. is too fiddly";
throws-like '3 !. "foo"', X::Obsolete, "!. can't do P5 concat";

# vim: ft=perl6
7 changes: 6 additions & 1 deletion S03-metaops/reduce.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 371;
plan 372;

=begin pod
Expand Down Expand Up @@ -389,5 +389,10 @@ ok ([+]) == 0, 'argumentless [+] parses';
is [:!a], [a => False], 'does [:!a] parse ok and give the right value';
}

{
$_ = [42];
is [.[0]].gist, '[42]', ". infix is not attempted in reduce";
}


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

plan 40;
plan 42;

=begin pod
Expand Down Expand Up @@ -96,4 +96,6 @@ throws-like '("a" R~ "b") = 1', X::Assignment::RO, 'Cannot assign to return valu
ok !([==] @a), "Rxx thunks the RHS";
}

throws-like '3 R. foo', X::Syntax::CannotMeta, "R. is too fiddly";
throws-like '3 R. "foo"', X::Obsolete, "R. can't do P5 concat";
# vim: ft=perl6
5 changes: 4 additions & 1 deletion S03-metaops/zip.t
@@ -1,7 +1,7 @@
use v6;

use Test;
plan 47;
plan 49;

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

Expand Down Expand Up @@ -118,4 +118,7 @@ is (1, 2 Z, 3, 4).flat.join('|'), '1|3|2|4', 'Z, flattens in list context';
ok !(1..* Z* 1..5 Z* 1..*).is-lazy, "laziness defeated by middle argument (Z*)";
}

throws-like '3 Z. foo', X::Syntax::CannotMeta, "Z. is too fiddly";
throws-like '3 Z. "foo"', X::Obsolete, "Z. can't do P5 concat";

# vim: ft=perl6

0 comments on commit 647e449

Please sign in to comment.