563 Commits

Author SHA1 Message Date
Ville Skyttä
c398b1c56f (testsuite) Fix get_hosts option docs. 2011-03-29 23:27:51 +03:00
Freddy Vulto
68e9a8e6eb (testsuite) Add -unsorted option to _get_hosts()
_known_hosts_real tests were failing after commit 81794a9:

   FAIL: Hosts should be put in COMPREPLY
   FAIL: Hosts should have username prefix and colon suffix

This is because tcl's get_hosts() is now doing a unique sort, but bash
_known_hosts_real() IS returning duplicates relying on bash's compgen/complete
to remove the duplicates).  Fixed by calling _get_hosts -unsorted.
2011-03-27 23:12:14 +02:00
Freddy Vulto
7cd17ada11 Fix __reassemble_comp_words_by_ref() unquoted pattern removal
Commit 8227e76 was failing on these `chown' tests in bash-4.1:

    FAIL: Check preserve special chars in funky\ user:Debia<TAB>
    FAIL: Check preserve special chars in funky\.user:Debia<TAB>
    FAIL: Check preserve special chars in fu\ nky.user:Debia<TAB>
    FAIL: Check preserve special chars in f\ o\ o\.\bar:Debia<TAB>
    FAIL: Check preserve special chars in foo\_b\ a\.r\ :Debia<TAB>

because a removal pattern is expanded:

    $ a=\\b
    $ w=\\
    $ echo ${a#$w}    # Doesn't work
    \b
    $ echo ${a#"$w"}  # Ok
    b
2011-03-27 22:08:55 +02:00
Ville Skyttä
a73774c833 Fix regressions and further tweak previous java completion patch.
Fix inner class regression, adapt test suite, turn off nospace for
single class completions, protect -o nospace for bash < 4.
2011-03-24 20:45:16 +02:00
Freddy Vulto
8227e76e09 Improve __reassemble_comp_words_by_ref() (Alioth #313057)
Prohibit word creation of characters if they're excluded from
$COMP_WORDBREAKS.  For example, with ':' included in $COMP_WORDBREAKS,
'a b:' should split to 'b' and ':'.  With ':' excluded from
$COMP_WORDBREAKS, 'a b:' should split to 'b:', NOT 'b' and ':'.
2011-03-24 00:00:58 +01:00
Ville Skyttä
2c78ae3ea1 (testsuite) Add basic xzdec test case. 2011-03-21 19:46:13 +02:00
Ville Skyttä
a6354b8107 Add reptyr completion. 2011-03-12 12:04:02 +02:00
Ville Skyttä
a34a380410 (testsuite) Add basic puppet test case. 2011-02-26 15:58:20 +02:00
Ville Skyttä
ab66ae79c2 (testsuite) Add basic mdadm test case. 2011-02-26 15:47:02 +02:00
Ville Skyttä
6042cbe2f5 Split rpm and rpmbuild completions and improve them both.
The option sets are different, and rpm should not have been used to
build packages since rpm 4.0, and could not have been used for that
since rpm 4.1.
2011-02-10 23:51:26 +02:00
Ville Skyttä
f96e15428c (testsuite) Add basic gendiff test case. 2011-02-07 21:01:01 +02:00
Ville Skyttä
cb01d8ea54 Add javaws completion. 2011-02-06 15:15:20 +02:00
Ville Skyttä
81794a9dcf (testsuite) Avoid duplicates in get_hosts() return value. 2011-02-05 12:27:35 +02:00
Ville Skyttä
80312be9af (testsuite) Use get_hosts() in xhost tests. 2011-02-05 12:24:49 +02:00
Ville Skyttä
74128a73ce Add mktemp(1) completion. 2011-01-24 00:20:32 +02:00
Guillaume Rousse
55c38e271c minimal tests for xfreerdp completion 2011-01-17 22:26:50 +01:00
Ville Skyttä
d6043b9609 Don't leak $options from iscsiadm completion, add basic test case. 2011-01-17 22:14:18 +02:00
Ville Skyttä
b1dbd1d712 (testsuite) Fix sysctl test case (Alioth: #312909). 2011-01-05 22:59:05 +02:00
Ville Skyttä
a0e7299717 (testsuite) assert_complete_one() fixes, revealed by ssh.exp. 2010-11-23 09:17:53 +02:00
Freddy Vulto
5a38f828d4 (testsuite) Split assert_complete() into
assert_complete_many() and assert_complete_one().
Fix ssh completion now that match_items() also matches on prompt.
2010-11-22 22:57:00 +01:00
Ville Skyttä
4b2c511e2d Get python options with _parse_help(). 2010-11-21 20:29:45 +02:00
Ville Skyttä
96908c87f1 Add lsof(8) completion. 2010-11-21 19:59:38 +02:00
Ville Skyttä
e9bf8773ec Add perl -V completion. 2010-11-19 22:12:43 +02:00
Ville Skyttä
43ec91619d Add perl -m-/-M- completion. 2010-11-19 22:11:48 +02:00
Ville Skyttä
ee1374f70b Add some perl option non-completions. 2010-11-19 22:10:46 +02:00
Freddy Vulto
11da957e45 (testsuite) `match_items()' matches on bash-prompt
Also made `match_items()' more strict about matching
space/newline/prompt after the last item.

Added options to match_items():
- end-newline
- end-prompt
- end-space
and transferred them to other functions.

Function `assert_complete()' now has a `-nospace' option to explicitly
disallow a space after a completion...

Function `assert_bash_list()' now expects a single item to be followed
by a newline.
2010-11-17 23:36:58 +01:00
Freddy Vulto
bc0bf2815c (testsuite) Uncomment testcases 2010-11-16 23:21:05 +01:00
Freddy Vulto
7e8fe15484 Merge branch 'master' of git+ssh://git.debian.org/git/bash-completion/bash-completion 2010-11-16 23:09:59 +01:00
Freddy Vulto
69f9c7c77e (testsuite) Fix _count_args tests to output newline
assert_bash_list() expects a newline terminated list

Plus small fixes to assert_bash_list_dir()
2010-11-16 23:06:13 +01:00
Ville Skyttä
c4eaba636f (testsuite) Add some perl module completion test cases (Alioth: #312832).
The -MFile::Sp and -MFile::Spec::Func test cases fail at the moment
but are not marked as expected failures, hoping for a quick fix for
the above bug ;)
2010-11-16 23:20:46 +02:00
Ville Skyttä
07f76d8f6c (testsuite) Fix cvs, cvsps, java, lftp, and wol fallout from commit c86b336. 2010-11-13 11:15:47 +02:00
Ville Skyttä
be5c8f4249 (testsuite) Ignore changed OLDPWD in xz.exp. 2010-11-13 10:51:31 +02:00
Freddy Vulto
6feb44ac0f (testsuite) Add missing dir to fixtures/acroread 2010-11-13 09:30:26 +01: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
Ville Skyttä
8f0055553b Add/improve various autotools completions. 2010-11-12 21:56:40 +02:00
Guillaume Rousse
6a51790506 test perldoc options completion 2010-11-07 20:17:28 +01:00
Freddy Vulto
de51dd3a89 (testsuite) Prepend relative files with $::srcdir
in an attempt to be able to run the tests successfully from within
autotools' `make distcheck'.
2010-11-05 21:28:48 +01:00
Freddy Vulto
0367d0bf57 (testsuite) Moved tool_start() code to tool_init()
${tool}_start was called from within `config/default_exp', but this
proves to be error-prone, because DejaGnu isn't fully initialized at
that point, causing an error when calling one of the DejaGnu methods
pass/fail/unsupported/xfail/unresolved/untested:

    can't read "multipass_name": no such variable

The right way seems to be calling ${tool}_start() from
${tool}_init().
2010-11-05 21:11:57 +01:00
Ville Skyttä
8dc1e86a7a Don't source bash-completion.log when running "make check".
I wonder why does such a file end up in our completions dir, but it
looks like one created by "make check" invocations.
2010-11-05 19:47:25 +02:00
Ville Skyttä
ed3f21b013 Create and remove the test/{log,tmp} dirs when appropriate. 2010-11-05 19:46:53 +02:00
Freddy Vulto
325b1c2fea (testsuite) Added expected failure for perldoc options completion
perldoc options don't complete anymore
2010-11-03 22:34:35 +01:00
Freddy Vulto
99d8cf290d (testsuite) Fix comment 2010-11-03 22:06:12 +01:00
Freddy Vulto
8daa291d6a Split test in two for ls.exp, expanding ~part
Depending on if user has or hasn't an existing home dir, the test should
respond differently, but it's useful if both tests execute.
2010-11-03 22:00:12 +01:00
Ville Skyttä
642ef5344f Add basic growisofs completion. 2010-11-03 21:11:49 +02:00
Ville Skyttä
7a174c0e1f Add ip completion (Debian: #600617). 2010-11-01 21:39:03 +02:00
Ville Skyttä
0f450219b6 Remove most "-o filenames" options to "complete".
Turn it on dynamically when needed instead; see doc/styleguide.txt for
a longer explanation.  This fixes many non-filename completions which
had been previously more or less broken due to unwanted
escape-as-filenames behavior.
2010-11-01 19:29:45 +02:00
Ville Skyttä
1c28fa983d (testsuite) Test sftp -F with sftp instead of ssh. 2010-11-01 19:29:45 +02:00
Freddy Vulto
ef8b4f2722 Fix perldoc completions to run without invoking autotools
Alioth #312729

See also:
http://www.mail-archive.com/bash-completion-devel@lists.alioth.debian.org/msg02143.html
2010-10-31 23:20:19 +01:00
Ville Skyttä
a877567477 Improve relevance of many user/group completions, depending on context.
_usergroup now has a -u option, and there are new _allowed_users and
_allowed_groups helpers.  These can be used to limit returned users
and/or groups to ones that the user has access to (or should be
assumed to have access to if running a "root command").

I had to remove a couple of "funky user" chown test cases because for
some reason they were broken by this change, I didn't immediately find
out why, and I couldn't come up with a valid use case that should be
supported for them that would be more beneficial than the relevance
improvements in this patch.
2010-10-31 21:28:44 +02: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