Add test for --max-expr-complexity

This commit is contained in:
Dianne Skoll
2025-09-11 11:20:29 -04:00
parent 804cf14a78
commit 57545ddc3f
2 changed files with 31 additions and 0 deletions

View File

@@ -795,6 +795,24 @@ done
../src/remind --flush -q ../tests/safety.rem 2025-08-13 >> ../tests/test.out 2>&1
# Test --max-expr-complexity
../src/remind --flush -q --max-expr-complexity=1000000 - 2025-01-01 <<'EOF' >> ../tests/test.out 2>&1
BANNER %
SET $AddBlankLines 0
FSET fib(n) iif(n < 3, 1, fib(n-1) + fib(n-2))
REM MSG fib(10) = [fib(10)]
REM MSG fib(15) = [fib(15)]
REM MSG fib(20) = [fib(20)]
REM MSG fib(21) = [fib(21)]
REM MSG fib(22) = [fib(22)]
REM MSG fib(23) = [fib(23)]
REM MSG fib(24) = [fib(24)]
REM MSG fib(25) = [fib(25)]
REM MSG fib(30) = [fib(30)]
EOF
cmp -s ../tests/test.out ../tests/test.cmp
if [ "$?" = "0" ]; then
echo "Remind: Acceptance test PASSED"

View File

@@ -39824,3 +39824,16 @@ nooooo....
../tests/safety.rem(37): [#0] In function `subst_b'
today
nooooo....
fib(10) = 55
fib(15) = 610
fib(20) = 6765
fib(21) = 10946
fib(22) = 17711
fib(23) = 28657
fib(24) = 46368
-stdin-(12): `-': Maximum expression complexity exceeded
-stdin-(3): [#0] In function `fib'
[remaining call frames omitted]
-stdin-(13): `-': Maximum expression complexity exceeded
-stdin-(3): [#0] In function `fib'
[remaining call frames omitted]