File locations are prefixed with `$::srcdir' so that `make distcheck' can
execute the test suite using a relative path.
The current working directory is removed from the test-suite-bash-prompt.
Furthermore, no more dynamic creation of files in dir $::srcdir/fixtures since
this dir is read-only during `make distcheck'. Instead create dynamic files in
$TESTDIR/tmp
The test suite uses these "directory" variables
tcl bash description
------------ ----------- ------------------------------------
$::srcdir $SRCDIR where `fixtures' reside, relative
$::srcdirabs $SRCDIRABS where `fixtures' reside, absolute
$::TESTDIR $TESTDIR where `runtest' is invoked, absolute
Steps to reproduce the problem:
$ LANG=POSIX ./run unit/_parse_help.exp
...
Running ./unit/_parse_help.exp ...
FAIL: short + long
FAIL: short + long, slash separated
Cause:
When comparing list items, `assert_bash_list()' expects the real list to be
sorted, whereas the output of `_parse_help' is unsorted.
These particular two tests were failing because they suffered the
following LANG-dependant sort-difference:
$ cat t.txt
-m
--n
$ LANG=en_US.UTF-8 sort t.txt
-m
--n
$ LANG=POSIX sort t.txt
--n
-m
Solution:
Made to default for `assert_bash_list' more-intuitive: unsorted, and added an
option `-sort' to explicitly enable sorting.
I felt uncomfortable adding yet another optional argument, so I seized this
opportunity to move subsequent optional arguments to single optional arguments.
E.g.:
assert_bash_list {expected cmd {test ""} {prompt /@} {size 20}} {
has now become:
# ...
# @param list $args Options:
# -nosort Compare list unsorted. Default is sorted
# -prompt Bash prompt. Default is `/@'
# -chunk-size N Compare list N items at a time. Default
# is 20.
assert_bash_list {expected cmd test {args {}}
(and the `test' argument has become mandatory).
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'.
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 a bug under bash-4 where completing:
scp -F 'spaced conf' <TAB>
causes `dequote' to yield errors:
bash: eval: line 1: unexpected EOF while looking for matching `''
bash: eval: line 2: syntax error: unexpected end of file
The bug occurs because of a bug in bash-4.0, where quoted words are split
unintended, see: http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html
Workaround is now to silence `dequote' in case of errors and wait for bash-4 to
be fixed...