aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-11-07 00:02:27 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-11-07 00:02:27 +0300
commit6747f318f50760d7a3a773e894df3d3ed449e5d7 (patch)
treec7168afc54b19d5f788d72700892b9d6e1fcba34 /tests
parent5f141848b88237959bd01603b427b792828d73ad (diff)
downloadsciteco-6747f318f50760d7a3a773e894df3d3ed449e5d7.tar.gz
test suite: fixed failure detection in the commandline-editing test cases
* The program exit code will usually not signal failures since they are caught earlier. * Therefore, we always have to capture and check stderr.
Diffstat (limited to 'tests')
-rw-r--r--tests/atlocal.in2
-rw-r--r--tests/testsuite.at14
2 files changed, 13 insertions, 3 deletions
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 3c533a6..2c76ab0 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -17,6 +17,8 @@ SCITECO_CMDLINE="$SCITECO --no-profile --fake-cmdline"
# is used.
SCITECOPATH="@abs_top_srcdir@/lib"
+GREP="@GREP@"
+
# Glib debug options
G_SLICE=debug-blocks
G_ENABLE_DIAGNOSTIC=1
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 30ae985..4bd4cfe 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -227,19 +227,27 @@ AT_SETUP([Jump to beginning of macro])
AT_CHECK([$SCITECO -e "%a-2\"< F< ' Qa-2\"N(0/0)'"], 0, ignore, ignore)
AT_CLEANUP
+#
+# Command-line editing bugs.
+#
# NOTE: It would generally be possible to use control codes like ^H (8)
# and ^W (23) for rubout as well, but this is tricky to write in a portable manner.
# Therefore we usally use the push/pop command-line commands { and }.
+# NOTE: Most errors are not reported in exit codes - you must check stderr.
+#
AT_SETUP([Rub out string append])
-AT_CHECK([$SCITECO_CMDLINE "@I/XXX/ H:Xa{-4D} :Qa-0\"N(0/0)'"], 0, ignore, ignore)
+AT_CHECK([$SCITECO_CMDLINE "@I/XXX/ H:Xa{-4D} :Qa-0\"N(0/0)'"], 0, ignore, stderr)
+AT_FAIL_IF([$GREP "^Error:" stderr])
AT_CLEANUP
AT_SETUP([Rub out of empty forward kill])
-AT_CHECK([$SCITECO_CMDLINE "@I/F/ J @I/X/ @FK/F/{-6D} Z-2\"N(0/0)'"], 0, ignore, ignore)
+AT_CHECK([$SCITECO_CMDLINE "@I/F/ J @I/X/ @FK/F/{-6D} Z-2\"N(0/0)'"], 0, ignore, stderr)
+AT_FAIL_IF([$GREP "^Error:" stderr])
AT_CLEANUP
AT_SETUP([Searches from macro calls])
-AT_CHECK([$SCITECO_CMDLINE "@^Um{:@S/XXX/} :Mm\"S(0/0)' Mm\"S(0/0)'"], 0, ignore, ignore)
+AT_CHECK([$SCITECO_CMDLINE "@^Um{:@S/XXX/} :Mm\"S(0/0)' Mm\"S(0/0)'"], 0, ignore, stderr)
+AT_FAIL_IF([$GREP "^Error:" stderr])
AT_CLEANUP
AT_BANNER([Known Bugs])