aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/testsuite.at22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 294bb5e..5cf3d4f 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -6,11 +6,11 @@ AT_COLOR_TESTS
AT_ARG_OPTION([valgrind],
AS_HELP_STRING([--valgrind], [Run tests under Valgrind (memcheck)]))
-# NOTE: There is currently no way to influence the return
-# code of SciTECO, except to provoke an error.
-# Since errors cannot be yielded explicitly, we use the
-# idiom "(0/0)" to enforce a "Division by zero" error
-# whenever we want to fail.
+# NOTE: We could use 1^C to get an unsuccessful return code.
+# However, this won't print any stack trace or error message.
+# Therefore, we still use the idiom "(0/0)" to enforce a "Division by zero"
+# error whenever we want to fail.
+# A proper error throwing construct should be used instead once it's available.
#
# NOTE: By convention, we double quote the SciTECO test case
# snippets, ie. put them between [[ and ]].
@@ -44,7 +44,7 @@ m4_define([TE_RUBOUT_WORD], [m4_format([%c], 23)])
AT_BANNER([Language features])
AT_SETUP([Number stack])
-TE_CHECK([[2%a,%a - 3"N(0/0)']], 0, ignore, ignore)
+TE_CHECK([[2%a,%a - 3"N(0/0)' $]], 0, ignore, ignore)
# It's not quite clear what would be the best semantics for comma:
# a) Superfluous commas as in ",," or "(1,)" should be an error.
# b) Superfluous commas should be ignored which is effectively what we do now.
@@ -55,6 +55,12 @@ TE_CHECK([[(1,) "~|(0/0)']], 0, ignore, ignore)
TE_CHECK([[1,(2)==]], 0, ignore, ignore)
AT_CLEANUP
+AT_SETUP([Exit status])
+TE_CHECK([[23]], 23, ignore, ignore)
+TE_CHECK([[42^C]], 42, ignore, ignore)
+TE_CHECK([[13$$]], 13, ignore, ignore)
+AT_CLEANUP
+
AT_SETUP([Radix])
TE_CHECK([[0^R]], 1, ignore, ignore)
TE_CHECK([[0U.^R]], 1, ignore, ignore)
@@ -103,8 +109,8 @@ AT_SETUP([Pass-through loops])
# More elegant would be a command for popping exactly one argument like <:$>.
TE_CHECK([[1,2,3,-1:<"~1;'%a=> Qa-6"N(0/0)']], 0, ignore, ignore)
TE_CHECK([[1,2,3,-1:<"~1;'%a= F>(0/0)> Qa-6"N(0/0)']], 0, ignore, ignore)
-TE_CHECK([[3<%a:>-3"N(0/0)']], 0, ignore, ignore)
-TE_CHECK([[3<%a :F>(0/0):>-3"N(0/0)']], 0, ignore, ignore)
+TE_CHECK([[3<%a:>-3"N(0/0)' $]], 0, ignore, ignore)
+TE_CHECK([[3<%a :F>(0/0):>-3"N(0/0)' $]], 0, ignore, ignore)
AT_CLEANUP
AT_SETUP([String arguments])