diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/atlocal.in | 9 | ||||
-rw-r--r-- | tests/testsuite.at | 32 |
2 files changed, 35 insertions, 6 deletions
diff --git a/tests/atlocal.in b/tests/atlocal.in index adaf928..8465f96 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -13,6 +13,15 @@ fi # For testing command-line editing: SCITECO_CMDLINE="$SCITECO --no-profile --fake-cmdline" +# Control characters for testing immediate editing commands with $SCITECO_CMDLINE. +# Often, we can use {...} for testing rubout, but sometimes this is not enough. +# Directly embedding escapes into strings is not portable. +# Theoretically, we could directly embed control codes, but for the time being +# I am trying to keep non-TECO sources clean of non-printable characters. +RUBOUT=`printf '\8'` +RUBOUT_WORD=`printf '\27'` +ESCAPE=`printf '\33'` + # Make sure that the standard library from the source package # is used. SCITECOPATH="@abs_top_srcdir@/lib" diff --git a/tests/testsuite.at b/tests/testsuite.at index cb1fe61..20869f4 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -198,6 +198,23 @@ AT_CHECK([$SCITECO -e "@EC'dd if=/dev/zero bs=512 count=1' Z= Z-512\"N(0/0)'"], AT_CHECK([$SCITECO -e "0,128ED @EC'dd if=/dev/zero bs=512 count=1' Z= Z-512\"N(0/0)'"], 0, ignore, ignore) AT_CLEANUP +# +# Command-line editing. +# +# This either uses the portable $RUBOUT and $RUBOUT_WORD variables or +# we use the push/pop command-line commands { and } from start states. +# +# NOTE: Most errors are not reported in exit codes - you must check stderr. +# +AT_SETUP([Rub out with immediate editing commands]) +# Must rub out @, but not the colon from the Q-Reg specification. +AT_CHECK([$SCITECO_CMDLINE "Q:@I/XXX/ ${RUBOUT_WORD}{Z-2\"N(0/0)'}"], 0, ignore, stderr) +AT_FAIL_IF([$GREP "^Error:" stderr]) +# Should not rub out @ and : characters. +AT_CHECK([$SCITECO_CMDLINE "@I/ @:foo ${RUBOUT_WORD}/ Z-3\"N(0/0)'"], 0, ignore, stderr) +AT_FAIL_IF([$GREP "^Error:" stderr]) +AT_CLEANUP + AT_BANNER([Regression Tests]) AT_SETUP([Glob patterns with character classes]) @@ -293,12 +310,8 @@ AT_CHECK([$SCITECO_CMDLINE "!foo!{-5D}"], 0, ignore, stderr) 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. +# Command-line editing regressions: +# See above for rules. # AT_SETUP([Rub out string append]) AT_CHECK([$SCITECO_CMDLINE "@I/XXX/ H:Xa{-4D} :Qa-0\"N(0/0)'"], 0, ignore, stderr) @@ -364,3 +377,10 @@ AT_SETUP([Recursion overflow]) AT_CHECK([$SCITECO -e "@^Um{U.a Q.a-100000\"<%.aMm'} 0Mm"], 0, ignore, ignore) AT_XFAIL_IF(true) AT_CLEANUP + +AT_SETUP([Rub out from empty string argument]) +# Should rub out the modifiers as well. +AT_CHECK([$SCITECO_CMDLINE ":@^Ua/${RUBOUT_WORD}{Z\"N(0/0)'}"], 0, ignore, stderr) +AT_CHECK([$GREP "^Error:" stderr], 0, ignore ignore) +AT_XFAIL_IF(true) +AT_CLEANUP |