Err, TERM=linux also causes errors when tests are run via cron.
Reset TERM=dummy.
Workaround is to do a CRON=running from within the cron job and only set
TERM=dummy when not run via cron.
The TERM=dummy setting causes backspaces (^H) to appear in stdout when running
from cron. Changing to TERM=linux should fix the ^H's in stdout AND the bug of
`meta_on' or `meta_off' escape sequences in stdout, caused by a bug in
supposedly libreadline5:
http://old.nabble.com/-PATCH-:-fix-libreadline5-linked-applications-sending-meta_on-or-meta_off-to-stdout-td25557585.html
Steps to reproduce output of ^H with TERM=dummy:
$ batch
warning: commands will be executed using /bin/sh
at> ./runUnit _known_hosts_real.exp --debug < /dev/tty40
at> ^D
NOTE: You need to connect a terminal (< /dev/tty..) to the test suite
when running from cron. See also doc/testing.txt, "Running tests via
cron".
- Refactored code to new function `_remove_cword_from_cmd()'
- Added `cword' parameter to `assert_complete()' and `assert_complete_dir()':
@param string $cword (optional) Last argument of $cmd which is an
argument-to-complete and to be replaced with the longest common
prefix of $expected. If empty string (default), `assert_complete'
autodetects if the last argument is an argument-to-complete by
checking if $cmd doesn't end with whitespace. Specifying `cword'
is only necessary if this autodetection fails, e.g. when the last
whitespace is escaped or quoted, e.g. "finger foo\ " or
"finger 'foo "
- Added support for `-F configfile'. This enables using a specially
crafted muttrc for automated testing.
- Centralized call to _get_cword
- Used _get_pword
- Specified non-wordbreak characters to _get_cword() & _get_pword() for
bash-4.
- Added automated tests for -f and -A
- Fixed test suite's assert_complete() (test/library.exp) to drop only
the last element
Changed the last `echo' to a `printf' to make completing `-n' or '-e'
come through. Declaring a function local (break_index & word_start)
also doesn't work on my machine: the functions become visible global. I
considered doing an unset -f at the end of __get_cword4, but I made them
global (__break_index & __word_start) because they're used so often.
Thanks to Sung Pae (Alioth #312030):
"This patch extends both __get_cword3() and __get_cword4() to accept an
additional integer argument that specifies how many places previous to
the current word the desired word resides, respecting any user
exceptions to COMP_WORDBREAKS."