2150 Commits

Author SHA1 Message Date
Freddy Vulto
9f107370c4 (testsuite) Added `sleep .1' after sending QUIT/INT to bash
See also: http://lists.alioth.debian.org/pipermail/bash-completion-devel/2010-February/002566.html
2010-02-11 23:09:46 +01:00
Crestez Dan Leonard
ebdd9cefdc Merge branch 'space-fix': Fix tests when BASH_COMPLETION or TESTDIR contain
spaces.

Conflicts:
	CHANGES
2010-02-09 15:45:40 +02:00
Ildar Mulyukov
6b30acc9ac bind *.ltx files to LaTeX family of programs
according to user request https://bugzilla.altlinux.org/show_bug.cgi?id=22443
2010-02-08 22:14:15 +02:00
Freddy Vulto
2cd91420d2 Merge branch 'fvu' 2010-02-07 15:21:44 +01:00
Freddy Vulto
b529cee550 Added _get_comp_words_by_ref()
This solves the following problems:
- now one function call suffices instead of two (_get_cword; _get_pword) if
  subsequent words need to be retrieved.  Also more than two words can be
  retrieved at once, e.g.: _get_comp_words_by_ref cur prev prev2 prev3
  Also this prevents passing of `wordbreakchars' to differ in calls to
  `_get_cword' and `_get_pword', e.g.: _get_comp_words_by_ref -n : cur prev
- passing by reference, no subshell call necessary anymore
- _get_pword now also takes into account the cursor position

Added testsuite proc `assert_no_output()'

Word of caution:

The passing-arguments-by-ref system in bash doesn't work if the new variable is
also declared local.  For example:

    t() {
        local a
        # ...
        eval $1=b
    }
    a=c; t a; echo $a  # Outputs "c", should be "b"
                       # Variable "a" is 'forbidden'

To make name collissions like this less likely to happen, but make the real
function still use readable variables, I've wrapped the `*_by_ref'
functions within an additional layer using variables prefixed with double
underscores (__).  For example:

    _t() {
        # Readable variables can still be used here
        local a
        # ...
        eval $1=b
    }
    t() {
        local __a
        _t __a
        eval $1=\$__a
    }
    a=c; t a; echo $a  # Outputs "b"
                       # Variable "__a" is 'forbidden'

Now only more obfuscated variables (starting with double prefix (__)) are
forbidden to use.
2010-02-07 15:18:58 +01:00
Crestez Dan Leonard
c72e20b42f Merge branch 'find-unique-completion-pair' 2010-02-07 01:09:17 +02:00
Ville Skyttä
6810e55645 (testsuite) Fix chown basic user completion test on systems with lots of users. 2010-02-05 22:44:04 +02:00
Ville Skyttä
35ebc8aec8 (testsuite) Add lftp hostname completion testing fixture. 2010-02-05 22:19:34 +02:00
Ville Skyttä
44f7ea3c5b Line length: 72 -> 79 as discussed on list. 2010-02-05 21:48:47 +02:00
Freddy Vulto
dc4d28bc11 (testsuite) mv fixture1 fixtures/shared/default 2010-02-05 15:16:19 +01:00
Freddy Vulto
c70c1ecb31 (testsuite) Added helper functions
- assert_source_completions()
- is_bash_completion_installed_for()

This allows for cleaner invocation of tests in `lib/completions/'.  For
example, `completion/perldoc.exp' now just contains:

    assert_source_completions perldoc

Skeleton test files for a command can be generated with:

    $ ./generate <command>
2010-02-05 14:35:45 +01:00
Freddy Vulto
8aca9ab62d (doc) Add reference to Tcl Style Guide. 2010-02-05 11:39:23 +01:00
Freddy Vulto
b9413e4151 (testsuite) Updated documentation
Added explanation about the two-file system: `completion/*.exp
calling completions in lib/completions/*.exp
2010-02-05 10:03:18 +01:00
Freddy Vulto
9b9bbab1ff (testsuite) Fix ssh test
Fix ssh test "First argument shouldn't complete with commands" if one
has hosts starting with "bas" in known hosts. (Alioth #312292)
2010-02-05 08:45:44 +01:00
Crestez Dan Leonard
dc18aae4e4 Add changes entry for Alioth #312306 2010-02-04 15:22:04 +02:00
Crestez Dan Leonard
ce624f7983 Use find_unique_completion_pair in chown test 2010-02-03 14:09:31 +02:00
Crestez Dan Leonard
2ad9001556 Add a find_unique_completion_pair proc.
Given a list of items this proc finds a (part, full) pair so that when
completing from $part $full will be the only option.
2010-02-03 14:08:55 +02:00
David Paleino
6663709d76 docs: styleguide, establish line wrapping and $() instead of `` 2010-02-02 19:02:26 +01:00
Crestez Dan Leonard
aac11de466 Fix nfs mount completion if the path to showmount contains a space. 2010-02-02 11:17:33 +02:00
Crestez Dan Leonard
c3bb4416d7 Fixed tests when BASH_COMPLETION or TESTDIR contain spaces. 2010-02-02 11:16:29 +02:00
Leonard Crestez
61f83856fb (testsuite) Fix chown test "crash" if root user/group is N/A (Alioth: 312306). 2010-02-01 21:29:47 +02:00
Freddy Vulto
d358036572 (testsuite) Fix assert_bash_type perldoc > perl
Make `assert_bash_type' reflect bash-side where `have perl' is checked,
and not perldoc, to determine whether `perldoc' completion should be
installed.
2010-01-31 11:37:29 +01:00
Ville Skyttä
db9c42340c (testsuite) Sync fmt test with other longopt only tests. 2010-01-30 15:04:02 +02:00
Ville Skyttä
8f4111d5a4 (testsuite) Don't fail long option tests if command has no long options.
Many basic commands do not have long options on non-GNU systems, mark such
tests as unsupported (if the command doesn't respond to --help) instead of
failing.

Implemented with the new $failcmd parameter to assert_exec().
2010-01-30 14:56:39 +02:00
Ville Skyttä
c5470fdf74 Simplify java classes-in-classpath-dirs completion.
We intentionally don't look into subdirs of dirs in classpath
(Debian: #496828) so a plain "ls" instead of "find" with non-portable
-maxdepth is fine.
2010-01-30 12:41:54 +02:00
Ville Skyttä
b996ff01cb (testsuite) Add java -jar test. 2010-01-30 12:36:29 +02:00
Ville Skyttä
050fb91d40 (testsuite) Add some java classpath tests. 2010-01-30 12:25:13 +02:00
Ville Skyttä
f62a4ad7b2 Indentation fixes. 2010-01-30 12:22:33 +02:00
Freddy Vulto
1061876bbc Merge branch 'fvu' 2010-01-29 23:24:58 +01:00
Freddy Vulto
d866854066 Fix _usergroup, cpio and chown completions
Improve test suite.
Thanks to Leonard Crestez (Alioth: #311396, Debian: #511788).

`assert_complete' is improved.  It proved difficult to tell tcl to ignore
backslash escapes, e.g. the `\b' is no BACKSPACE but a literal `b'.  The added
function `split_words_bash' should to the trick now.

Added function `assert_no_complete' which can also be reached by calling
`assert_complete' with an empty `expected' argument:

    assert_complete "" qwerty
2010-01-29 23:23:30 +01:00
Ville Skyttä
e7d7ae81ef (testsuite) Add missing assert_env_unmodified tests. 2010-01-28 01:07:44 +02:00
Ville Skyttä
f3b791baeb (testsuite) Always look for command availability before testing completion. 2010-01-28 01:00:20 +02:00
Ville Skyttä
f579b38410 (testsuite) Include shopt states in saved environment. 2010-01-28 00:58:17 +02:00
Ildar Mulyukov
3438a5547a Add showmount completion (Alioth: #312285). 2010-01-26 23:33:24 +02:00
Ville Skyttä
6328b108a2 Fix NFS completion if path to showmount contains spaces (Alioth: #312285). 2010-01-26 23:17:48 +02:00
Ville Skyttä
dc8af65161 (testsuite) Use kern instead of fs to test sysctl completion.
FreeBSD does not have fs.* (has vfs.* instead).  Linux has kernel.*,
FreeBSD kern.*.
2010-01-24 23:58:46 +02:00
Ville Skyttä
c0d57b0bea (testsuite) Use File::Path instead of HTML::Parser to test perldoc.
HTML::Parser is not a "core" Perl module.
2010-01-24 23:36:01 +02:00
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
Ville Skyttä
836adbbb2d Use == instead of =~ for simple suffix matching. 2010-01-24 22:11:52 +02:00
Ville Skyttä
359db46260 Don't bother looking for showmount if not doing NFS completion. 2010-01-24 19:43:16 +02:00
Ville Skyttä
5c5d804696 Update patch submission guidelines. 2010-01-24 19:36:10 +02:00
Leonard Crestez
c5951118e9 Fix NFS mounts completion (Alioth: #312285). 2010-01-24 19:27:15 +02:00
Ville Skyttä
258736a47b Look for showmount in $PATH first for easier mockability (Alioth: #312285). 2010-01-24 16:54:14 +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ä
e24fc84c8d Recognize long equivalents to -f and -C when looking for Makefile or dir option. 2010-01-19 23:14:46 +02: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ä
ab05989877 Do not alias sed to gsed (Alioth: #311393). 2010-01-19 21:59:08 +02:00
Ville Skyttä
7914d17468 Avoid use of POSIX character classes with awk for mawk compatibility. 2010-01-19 19:09:15 +02:00