aboutsummaryrefslogtreecommitdiff
path: root/tests/expr.test
AgeCommit message (Collapse)Author
2016-03-20Posix requires "" to be false, and 00 should be false, and -0 should be false.Rob Landley
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.
2016-03-16Move whitespace and curly brackets around, move reference URLs to top of file,Rob Landley
eliminate syntax_error() function (just call error_exit() directly), eliminate advance() wrapper, pipe expected error messages in test to /dev/null
2016-03-16Fix type coercion bugs in expr.Andy Chu
All tests pass now; this fixes the 2 remaining failures, including a segfault. The structure of the code has changed a lot -- instead of having a tiny function per operator, we have eval_op() which does common type coercion and then evaluates the operator. I tried writing it a couple different ways, and this was the cleanest. The OPS table now contains the operator string, precedence level, signature for type coercion, and operator ID.
2016-03-16Fix the operator precedence in expr.Andy Chu
expr now uses the precedence table specified by POSIX, implemented using the "precedence climbing" algorithm. See the references at the top of eval_expr(). This fixes 3 of 4 failing tests. I also added more tests for correct behavior and for syntax errors. This includes a new test exposing a segfault, related to type coercion.
2016-03-02Factor out command name at the start of test name, have runtest.sh print it.Rob Landley
2015-05-12Set the executable bits on all the *.test files. (Wasn't consistent, is now.)Rob Landley
2014-12-01Refactor expr and add another test entry that works with TEST_HOST=1 but not ↵Rob Landley
with the one in pending.
2014-11-30Tests for operator priority groupings.Rob Landley
2014-09-20Move testsuite out of scripts/test into its own top level tests directory, ↵Rob Landley
and make ctrl-c kill "make test" more reliably.