Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tests to make sure . has proper precedence
  • Loading branch information
TimToady committed Sep 28, 2015
1 parent 139c10c commit be4fc4f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion S03-operators/precedence.t
Expand Up @@ -13,7 +13,7 @@ proper separation of the two levels.
=end pod

plan 59;
plan 63;


# terms
Expand Down Expand Up @@ -43,6 +43,11 @@ is(!0 * 2, 2, "unary ! binds tighter than *");
ok(!(0 * 2), "beh");
is(?2*2, 2, "binary -> numify causes reinterpretation as, binds tighter than *");

is -2**2 . abs, 4, "on left side . is looser than ** and left-to-right with unary -";
is -2**2 . abs + 1, 5, "on right side . is tighter than addition";
is -2**2 . abs.Str.ord, "4".ord, "on right side . is tighter than methodcall";
is -1 * -1 . abs, -1, "on left side . is tighter than *";

# multiplicative

is(4 + 3 * 2, 10, "* binds tighter than binary +");
Expand Down

0 comments on commit be4fc4f

Please sign in to comment.