https://bugzilla.redhat.com/show_bug.cgi?id=541423#c3
Done by adding the eval back. The only thing that this breaks AFAIK
is handling of known hosts filenames that have more than one
consecutive space in them, but I couldn't figure out how to get both
to work and IMO support for files starting with ~ is much more
important.
https://bugzilla.redhat.com/show_bug.cgi?id=541423#c2
As a side effect, this simplifies things somewhat and grabs user and
global known hosts filenames from config files with one command
instead of doing one for each.
Moved making-expected-list-unique out of `match_items()' & `get_hosts()'
into `assert_complete()' because the former are low level functions and
items need not necessarily be unique. They only need to be unique when
we're actually testing *completions*.
This fixes the auto tests for `finger' and `ssh' on machines where an IPv6 host
"::1" is mentioned in /etc/hosts.
Added helper function __ltrim_colon_completions.
To run the tests:
./runCompletion finger.exp ssh.exp
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