aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/testsuite.at11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at
index bc5c6da..73d4440 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -49,6 +49,9 @@ TE_CHECK([[23:=]], 0, [23], ignore)
TE_CHECK([[1 2= =]], 0, ignore, ignore)
TE_CHECK([[033-27"N(0/0)']], 0, ignore, ignore)
TE_CHECK([[@0ff-255"N(0/0)']], 0, ignore, ignore)
+# Overflows should be catched
+TE_CHECK([[@0ffffffffffffffffff$]], 1, ignore, ignore)
+TE_CHECK([[-@0ffffffffffffffffff$]], 1, ignore, ignore)
# floating point numbers
# NOTE: %q does not change the register's number type.
TE_CHECK([[1.Ua 0.1%a:=]], 0, [1.1], ignore)
@@ -56,6 +59,8 @@ TE_CHECK([[1Ua 0.1%a:=]], 0, [1], ignore)
TE_CHECK([[23.04:=]], 0, [23.04], ignore)
TE_CHECK([[0.04:=]], 0, [0.04], ignore)
TE_CHECK([[23.04#0:=]], 0, [23], ignore)
+AT_SKIP_IF([test $TECO_NUMBER -lt 64])
+TE_CHECK([[11111111111111111111.1:=]], 0, [11111111111111110656], ignore)
AT_CLEANUP
AT_SETUP([Number stack])
@@ -733,6 +738,12 @@ TE_CHECK_CMDLINE([[[.a@^Um{].b}Mm{-2D}]], 0, ignore, stderr)
AT_FAIL_IF([$GREP "^Error:" stderr])
AT_CLEANUP
+AT_SETUP([Rub out numbers in macro calls])
+# This was causing memory corruptions, that would at least show up under Valgrind.
+TE_CHECK_CMDLINE([[@^Um{023$}Mm{-2D}]], 0, ignore, stderr)
+AT_FAIL_IF([$GREP "^Error:" stderr])
+AT_CLEANUP
+
AT_SETUP([Searches from macro calls])
TE_CHECK_CMDLINE([[@^Um{:@S/XXX/} :Mm"S(0/0)' Mm"S(0/0)']], 0, ignore, stderr)
AT_FAIL_IF([$GREP "^Error:" stderr])