Added test suite function `get_known_hosts' which calls bash's `_known_hosts_real'.
Also the `finger' test "Tab should complete partial hostname" now skips hosts starting with character in COMP_WORDBREAKS leaving that to test for another test case.
See also: https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312220&group_id=100114
Some versions of the default word list for look may return
non-completable entries (e.g. due to sort order mismatch -- dictionary
vs non-dictionary one, case sensitivity etc -- between sort order in
default word list and look's defaults). As a side effect, fixes also
the test case when a lot of words are returned.
While at it, drop --eval completion test because I couldn't get it to
work with assert_complete (probably because I couldn't escape the
command properly here, see --eval|-E completion in contrib/rpm), and
no longer needed match_max fiddling.
The linefeed between the final "d" and "}" seems to be significant for
these versions of sed. And they are quite anal about comments, so
move them outside of the sed statement here.
Directories `a\b' and `a*b' are now created run-time on a
non-Cygwin/Windows system only. Tests concerning these directories will
also be run only on a non-Cygwin/Windows system.
(Alioth #312191)
On bash-3, completing a b c: with COMP_WORDBREAKS -= : would result in the
current word being bc: (Alioth #312190)
Added unit test, run via:
./run unit/_get_cword.exp
This fixes completing filenames containing single quote (') on bash-4.
Also added emulation of `-o filenames' to _filedir.
Added tests for _filedir.
Fixed array assignment within __reassemble_comp_words_by_ref().
This allows tab-completion of test scripts to run, e.g.:
$ ./run unit/comp<TAB>
$ ./run unit/compgen.exp
Instead of the old way:
$ ./runUnit compgen.exp
The COMP_ settings of the last test of _count_args() were falling through to
the first test of _get_cword(), causing it to fail.
Unset COMP_ variables within the unit tests setup & teardown.
Fixed last test at `_count_args.exp' by solving conflicting settings of
COMP_CWORD and COMP_POINT.
Steps to reproduce the problem:
$ ./runUnit _count_args.exp _get_cword.exp
...
Running ./unit/_count_args.exp ...
Running ./unit/_get_cword.exp ...
ERROR Unexpected output from bash command "_get_cword should run without errors":
bash: $index: substring expression < 0
...
If a word is made up of multiple word separator characters:
$ a b::<TAB> # CWORDS are: a, b, and :: (correct)
__reassemble_comp_words_by_ref() couldn't handle this. It assumed CWORDS were:
$ a b::<TAB> # CWORDS: a, b, : and : (but they're not)
Added test case for this. To run the automated tests:
./runUnit _get_cword.exp
The solution for bash-4 is to remove the colon from COMP_WORDBREAKS:
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
The workaround for bash-3, or bash-4 with a colon in COMP_WORDBREAKS,
is to call:
__ltrim_colon_completions "$cur"
after completions have been put in COMPREPLY.
See also: E13) Why does filename completion misbehave if a colon appears
in the filename? - Bash FAQ, http://tiswww.case.edu/php/chet/bash/FAQ
Actually enhanced __get_cword3 to _get_cword, and removed __get_cword4.
__get_cword4 could handle chars to exclude from COMP_WORDBREAKS, but
failed with partial quoted arguments (e.g. "a 'b c|", | = cursor
position). This was no problem till bash-4.0.35, because bash < 4.0.35
also returned partial quoted arguments incorrectly. See also:
http://www.mail-archive.com/bug-bash@gnu.org/msg06094.html
Now that bash-4.0.35 returns quoted arguments ok, __get_cword3 is
enhanced to also handle chars to exclude from COMP_WORDBREAKS. Because
__get_cword3 also handles partial quoted arguments correctly, this makes
__get_cword3 suitable for bash-4 as well.
Code in `unit_start()' and `completion_start()' is merged and put central in
lib/library.exp:
- start_bash()
- source_bash_completion()
- init_tcl_bash_globals()
Global string variable `bash_versinfo_0' is replaced with list variable
`BASH_VERSINFO'.
Completing directories after `screen -c' passes on bash-4 now that
_filedir does a `compopt -o filenames'.
The test yields an expected failure on bash-3.