OSDN Git Service

Tests for operator priority groupings.
authorRob Landley <rob@landley.net>
Sun, 30 Nov 2014 20:10:36 +0000 (14:10 -0600)
committerRob Landley <rob@landley.net>
Sun, 30 Nov 2014 20:10:36 +0000 (14:10 -0600)
tests/expr.test

index cce7d9d..1c038a5 100644 (file)
@@ -8,3 +8,12 @@ testing "expr string" "expr astring" "astring\n" "" ""
 testing "expr 1 + 3" "expr 1 + 3" "4\n" "" ""
 testing "expr 5 + 6 * 3" "expr 5 + 6 \* 3" "23\n" "" ""
 testing "expr ( 5 + 6 ) * 3" "expr \( 5 + 6 \) \* 3" "33\n" "" ""
+testing "expr * / same priority" "expr 4 \* 3 / 2"  "6\n" "" ""
+testing "expr / * same priority" "expr 3 / 2 \* 4" "4\n" "" ""
+testing "expr & before |" "expr 0 \| 1 \& 0" "0\n" "" ""
+testing "expr | after &" "expr 1 \| 0 \& 0" "1\n" "" ""
+testing "expr | & same priority" "expr 0 \& 0 \| 1" "1\n" "" ""
+testing "expr % * same priority" "expr 3 % 2 \* 4" "4\n" "" ""
+testing "expr * % same priority" "expr 3 \* 2 % 4" "2\n" "" ""
+testing "expr = > same priority" "expr 0 = 2 \> 3" "0\n" "" ""
+testing "expr > = same priority" "expr 3 \> 2 = 1" "1\n" "" ""