152 Commits

Author SHA1 Message Date
Ville Skyttä
5c6f45d5bb (testsuite) Add cvs roots completion test. 2010-01-24 23:35:32 +02:00
Ville Skyttä
89e52de0c5 (testsuite) Fix cvsps non-option completion test, add test for options.
"cvsps " completion failed when there was nothing in ~/.cvspass,
create a fixture for generic cvs use containing one, and use it.
2010-01-24 23:32:19 +02:00
Leonard Crestez
c5951118e9 Fix NFS mounts completion (Alioth: #312285). 2010-01-24 19:27:15 +02:00
Freddy Vulto
dde071d009 (testsuite) Fixed finger test
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
2010-01-24 10:32:41 +01:00
Ville Skyttä
7e03431ed7 (testsuite) Add basic tests for make. 2010-01-19 23:13:14 +02:00
Ville Skyttä
42b839e817 (testsuite) Enable cvs test. 2010-01-19 23:12:07 +02:00
Ville Skyttä
5d9e4f0c69 (testsuite) Enable gzip and bzip2 tests. 2010-01-18 19:20:40 +02:00
Ville Skyttä
556d1304d0 (testsuite) Add check for awk with POSIX character classes. 2010-01-17 15:36:01 +02:00
Ville Skyttä
942b916aa1 (testsuite) Don't fail dcop test if a DCOP server is not running. 2010-01-16 17:30:26 +02:00
Ville Skyttä
f8eec776e2 Weed out look completions not starting with current word.
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.
2010-01-16 17:30:02 +02:00
Ville Skyttä
f0c717b2be (testsuite) cd to correct top level dir first in runLint. 2010-01-16 15:54:28 +02:00
Ville Skyttä
8d6570670a (testsuite) It's not the empty alternative that's unportable with sed, it's \|. 2010-01-16 15:17:35 +02:00
Ville Skyttä
45698f2ae8 (testsuite) Add simple "lint" script for finding common issues.
Currently flags one potential awk issue in wireless-tools, but that
should be a non-issue because wireless-tools is a Linux thing.
2010-01-16 13:55:00 +02:00
Ville Skyttä
6a7a838310 (testsuite) Check rpm -q completion against actual installed packages.
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.
2010-01-16 12:59:21 +02:00
Ville Skyttä
ef7f9dc89e (testsuite) Allow possibly leading whitespace in match_items() chunks > 1.
Thanks to Freddy Vulto.
2010-01-16 12:56:29 +02:00
Adrian Friedli
e8f6edc5af Add ipv6calc completion. 2010-01-14 21:19:09 +02:00
Ville Skyttä
51a772f99f (testsuite) assert_exec() default test title grammar fix. 2010-01-14 20:19:52 +02:00
Ville Skyttä
9f49a10117 (testsuite) Escape more regexp metacharacters. 2010-01-09 12:46:49 +02:00
Ville Skyttä
66f5c11ab7 (testsuite) Add simple rpm completion tests. 2010-01-09 12:24:19 +02:00
Ville Skyttä
eb70bc8431 (testsuite) Fix ypmatch test case.
Completion is done for ypmatch's 2nd arg only at the moment.
2010-01-06 13:20:28 +02:00
Ville Skyttä
77dee3a323 (testsuite) FreeBSD and Solaris sed compatibility fixes.
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.
2010-01-03 23:49:19 +02:00
Ville Skyttä
25a0fcf1b4 Hook up openssl tests, do env modification checks. 2010-01-03 16:25:33 +02:00
Ville Skyttä
360b3dbe19 (testsuite) Indentation fixes. 2010-01-03 15:56:00 +02:00
Ville Skyttä
3d43cdfd2b (testsuite) Remove some obsolete comments. 2010-01-03 15:52:18 +02:00
Ville Skyttä
ec3227366a (testsuite) Make diff_env() compatible with Solaris sed.
It appears to tolerate comments only at beginning of line.
2010-01-03 15:42:32 +02:00
Guillaume Rousse
38516ee431 Merge branch 'master' of git+ssh://git.debian.org/git/bash-completion/bash-completion 2009-12-31 17:36:20 +01:00
Freddy Vulto
3f0bfbc5ae Fix __reassemble_comp_words_by_ref()
Completing "a b " returned cur=b instead of cur=nothing if a wordbreak
character was specified.
2009-12-31 11:12:15 +01:00
Ville Skyttä
9c402241c4 Add rtcwake completion. 2009-12-30 22:59:17 +02:00
Freddy Vulto
f321c377af (testsuite) Delete directory fixtures/_filedir/a\b
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)
2009-12-30 14:48:17 +01:00
Freddy Vulto
3251038c9d Fix __reassemble_comp_words_by_ref()
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
2009-12-30 09:43:16 +01:00
Guillaume Rousse
2e1b780d84 remove individual authorship notices, I'm already present in the AUTHORS file 2009-12-30 00:00:55 +01:00
Guillaume Rousse
4d4b6e9ba6 add support for test suite 2009-12-29 23:39:06 +01:00
Guillaume Rousse
3d584c94cb set BASH_COMPLETION_COMPAT_DIR to BASH_COMPLETION_DIR, to avoid sourcing actual /etc/completion.d directory before tests 2009-12-29 23:07:06 +01:00
Guillaume Rousse
84c20852a3 ensure HOME is changed before running test, to avoid polluting known_hosts result with tester environment 2009-12-29 23:05:28 +01:00
Raphaël Droz
14588b8491 Add xsltproc completion (Alioth: #311843). 2009-12-29 00:10:13 +02:00
Ville Skyttä
d15c096f0b Add cvsps completion. 2009-12-28 23:45:03 +02:00
Ville Skyttä
c6ce22ae44 (testsuite) _vncviewer_bootstrap getting unset is expected, don't fail on it. 2009-12-26 12:58:46 +02:00
Freddy Vulto
c9c98da36e Fixed `quote_readline'.
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().
2009-12-24 10:00:29 +01:00
Freddy Vulto
f9db6abdc1 (testsuite) Added shell script `run'
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
2009-12-24 09:43:24 +01:00
Freddy Vulto
fec41f3c74 (testsuite) Added function `assert_bash_list_dir' 2009-12-24 09:41:22 +01:00
Ville Skyttä
8caddc47cf Protect grep invocations from user aliases (Alioth: 312143). 2009-12-15 23:48:10 +02:00
Freddy Vulto
359d242a49 (testsuite) Unset COMP_ variables at setup()
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
    ...
2009-12-12 12:36:38 +01:00
Freddy Vulto
736fa43e9f (testsuite) Fix comment 2009-12-12 12:08:07 +01:00
Ville Skyttä
b8ffa2dc48 Add some unit tests for _count_args. 2009-12-11 00:14:02 +02:00
Ville Skyttä
d1da93448f Comment spelling fixes. 2009-12-10 23:53:22 +02:00
Freddy Vulto
b1e58b1a0e Fix __reassemble_comp_words_by_ref()
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
2009-12-10 21:28:24 +01:00
Freddy Vulto
6fe53ef0e6 Fixed completing perl modules containing colons
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
2009-12-09 22:13:56 +01:00
Freddy Vulto
08c5878483 Merged __get_cword3 & __get_cword4 to _get_cword
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.
2009-12-06 23:16:31 +01: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
c4f3e907cd (testsuite) Fix screen test
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.
2009-12-04 22:12:54 +01:00