From 6aba814b28cddd45c7301c39dccd65b316eb5c82 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 20 Mar 2016 20:39:27 -0500 Subject: Posix requires "" to be false, and 00 should be false, and -0 should be false. Fix memory leaks in regex. Simplify regex check (if we matched, subexpression had to match). Don't exit() from a command, set exitval and return. --- tests/expr.test | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/expr.test') diff --git a/tests/expr.test b/tests/expr.test index c6dc261b..da3feea1 100755 --- a/tests/expr.test +++ b/tests/expr.test @@ -19,6 +19,9 @@ testing "* % same priority" "expr 3 \* 2 % 4" "2\n" "" "" testing "= > same priority" "expr 0 = 2 \> 3" "0\n" "" "" testing "> = same priority" "expr 3 \> 2 = 1" "1\n" "" "" +testing "00 | 1" "expr 00 \| 1" "1\n" "" "" +testing "-0 | 1" "expr -0 \| 2" "2\n" "" "" +testing '"" | 1' 'expr "" \| 3' "3\n" "" "" testing "/ by zero" "expr 1 / 0 2>/dev/null; echo \$?" "2\n" "" "" testing "% by zero" "expr 1 % 0 2>/dev/null; echo \$?" "2\n" "" "" -- cgit v1.2.3