11 Commits

Author SHA1 Message Date
Ville Skyttä
6589a0d61b Drop support for bash < 4.1, clean up no longer needed low hanging cruft. 2011-04-21 12:20:59 +03:00
Freddy Vulto
c86b336769 (testuite) Fix tests to run with autotools' make distcheck
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
2010-11-12 23:35:36 +01:00
Freddy Vulto
83bcd69557 (testsuite) Fix _parse_help for LANG=POSIX
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).
2010-10-31 17:51:14 +01:00
Ville Skyttä
7f5c64e580 (testsuite) Add some [host]:port cases to known hosts related tests. 2010-09-28 17:59:31 +03:00
Freddy Vulto
51b3e20ebc (testsuite) Drop ending block comments
Instead of writing `}; # if', write just `}' as was discussed here:

    http://www.mail-archive.com/bash-completion-devel@lists.alioth.debian.org/msg01815.html
2010-06-18 17:21:38 +02:00
Crestez Dan Leonard
c3bb4416d7 Fixed tests when BASH_COMPLETION or TESTDIR contain spaces. 2010-02-02 11:16:29 +02:00
Freddy Vulto
8a70568066 (testsuite) Centralized test start functions
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'.
2009-12-05 14:53:47 +01:00
Freddy Vulto
932a4db5df (testsuite) Fix scp completions
match_items() now does a better job at maintaining a tcl list, that's
probably why the double escaping at scp isn't necessary anymore.
2009-12-03 18:44:30 +01:00
Freddy Vulto
a9717be57b (testsuite) Moved location of making-list-unique
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*.
2009-11-25 22:31:29 +01:00
Freddy Vulto
1be84710d2 Silence completing scp/sftp/ssh -F '' on bash-4
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...
2009-10-04 18:14:16 +02:00
Freddy Vulto
567eb37802 Reviewed tests s* 2009-07-31 12:20:51 +02:00