Changed `out' parameter of `assert_bash_exec()' to accept also -1 and 0:
@param mixed $out (optional) Reference to variable to hold output.
If variable equals -1 (default) the bash command is
expected to return no output. If variable equals 0,
any output from the bash command is disregarded.
This fixes the situation of commit cfcf9fa where contrib/ri was causing
invisible errors when running the test suite.
- Added code comments to _get_cword, __get_cword3 & __get_cword4
- (testsuite) Added tests for _get_cword
- (testsuite) Bugfixes assert_bash_exec() && match_items()
Bash-4 splits COMP_WORDS using characters from COMP_WORDBREAKS, but has
a bug where quoted words are also splitted, see:
http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html
__get_cword3 is used for bash-2/3 and __get_cword4 is used for bash-4.
__get_cword4 handles well temporarily disabling of COMP_WORDBREAK
characters, but fails quoted words (a 'b c) and subshells (a $(b c).
See the expected failures when running the automated tests.
__get_cword3 does a better job of returning quoted words.
To run the automated tests on bash-3/4:
$ ./runUnit _get_cword.exp [--tool_exec <path to bash-3/4 binary>]
assert_env_unmodified() now calls `diff_env' with `LAST-ARG' as the last
argument. Now $_ becomes `LAST_ARG' and $_ doesn't interfere with the
diff anymore as it would if $_ was the sed script.
Added line continuation (\) to bash script of `get_hosts_avahi()'.
- Fix get_hosts_avahi() if avahi-browse not available
- Removed test "Tab should complete hostnames" from finger since it's
returning (for the moment) undetectable ip-addresses from known_hosts
files. Furthermore the next test "Tab should complete partial
hostname" is testing the same.
Quote sed output ("\1") retrieving "GlobalKnownHostsFile/UserKnownHostsFile" to
prevent bash globbing of special characters, e.g. '*'.
Added unit test "Config file containing star (*) should work".
Added test library function `assert_bash_list()'.
To run unit tests:
cd test && ./runUnit _known_hosts_real.exp
Fixed `assert_complete()' to remove an optional (partial) argument from
`cmd' when expecting `cmd + longestCommonPrefix'.
Added `prompt' argument to procs `assert_bash_exec()' &
`sync_after_int()'
The local timeout settings `-timeout 1' in some loops seemed to cause
inpredictable results, e.g. with `./runCompletion dkpg.exp' since this
test has a long list to match. Sometimes the `spawn_id' was gone before
the `teardown' method was called.
Removing the short timeout seems to give more predictable results.
Fix `assert_complete' to expect the longest common prefix to be presented as completion.
When trying to do a:
package require textutil::string
it appeared DejaGnu overwrites `unknown', the tcl function that is called to attempt autoloading. A workaround is used for tcl auto-loading to work: `init.tcl' is reloaded to restore the original `unknown' function:
source [file join [info library] init.tcl]
See also: http://fvue.nl/wiki/DejaGnu:_proc_"tclPkgUnknown_..."_does_not_exist
`match_items()' now uses bash sort instead of tcl lsort.
The difference in sorting happens because bash and tcl use a different sorting order:
* bash sort uses the current locale's collating sequence and character set
* tcl lsort uses a C-like sort order where each character is sorted according to its numeric value
See also: http://fvue.nl/wiki/Tcl:_Lsort_output_differs_from_bash_sort
This fix allows the `dpkg -L' test to compare all packages. To run the test:
./runCompletion dpkg.exp
- First argument shouldn't complete with commands
- Tab should complete partial hostname
To run the tests: $ cd test && ./runCompletion ssh.exp
Added test library function: assert_complete_partial