Erik's ToolBox Documentation
Index

Interpreter Test Reference — Expressions and Operators

These tests verify expression evaluation: arithmetic, string and boolean operators, literals, operator precedence, the ternary and set-membership operators, and compound assignment. Most use the TestEval* helpers, which evaluate a single expression and compare the typed result.

Test List

Test What it verifies
EvalTests Baseline expression evaluation: arithmetic (1+2*3), abs, power, strlen, strpos, and round, evaluated in both Integer and Decimal contexts.
EvalIntegerAndDecimalTests Unary sign, the four arithmetic operators, integer div/mod (including negative operands), mixed precedence, abs, strlen, strchecksum, and decimal division/rounding.
EvalTextAndCodeTests Text functions as expressions: concatenation, uppercase/lowercase, copystr, delstr, delchr, convertstr, incstr, insstr, padstr, selectstr, and strsubstno; plus a Code-typed result.
EvalBooleanTests Boolean literals and and/or/not; the full comparison operator set over integers, decimals, text, dates, times, and datetimes.
EvalDateTimeLiteralTests Date/time literals (20230515D, 0D, 120000T, 0DT), dmy2date, date arithmetic, date2dmy/date2dwy, and createdatetime.
EvalDurationAndOptionTests Integer literals evaluated in a Duration context and in an Option context.
OperatorPrecedenceTests Full precedence ladder (real AL): multiplicative vs additive, left-to-right same-level, div/mod at multiplicative level, parentheses, unary binding, comparisons below arithmetic, and above or, and the corrected not precedence (not binds tighter than and/or).
EvalTernaryAndParenTests Nested parentheses and the condition ? a : b ternary operator for both Integer and Text results.
CompoundAssignmentTests +=, -=, *=, /= for Integer, Decimal, and Text (+= concatenation).
XorOperatorTests The xor boolean operator, its truth table, that it binds at the multiplicative level like and, that not binds tighter, and its use with comparisons and in assignments.
InOperatorTests The in set-membership operator with value lists, ranges ([1..5]), mixed sets ([1, 3..5, 9]), text and Code ranges, variable set elements, use as a Boolean expression value, and not (x in [...]).