362 Commits

Author SHA1 Message Date
Ville Skyttä
6301ee273b Fix finger test failure when _known_hosts_real returns duplicates. 2010-04-26 21:58:14 +03:00
Ville Skyttä
9c9df7f2b7 Add pkgtools fixture, test port{upgrade,install} and pkg_deinstall against it. 2010-04-26 21:36:04 +03:00
Freddy Vulto
59e7d21e09 (testsuite) Fix screen accessing $::BASH_VERSINFO 2010-04-26 19:53:13 +02:00
Freddy Vulto
827ad88ebb (testsuite) Expand PATH with 'sbin' directories
This allows for testing completions of system administrator commands,
which are installed via the same PATH expansion in
`bash_completion.have()'
2010-04-22 22:22:50 +02:00
Ville Skyttä
c5348d8678 Run delegated test tools/scripts with exec. 2010-04-21 23:34:27 +03:00
Ville Skyttä
f9f49786ca Fix running test scripts without giving a path to them.
For example "cd test ; bash runCompletion [...]".
2010-04-21 23:19:34 +03:00
Ville Skyttä
a7cd88bb67 Invoke "run" with the same bash as runCompletion and runUnit are run with.
Makes things a bit easier on systems that don't have bash installed in /bin.
2010-04-21 23:05:13 +03:00
Ville Skyttä
be649e63be Set cancel test outcome to untested, not unresolved if adding a test job fails.
E.g. lp installed, but lpd not running which is not a rare scenario.
2010-04-21 20:30:49 +03:00
Ville Skyttä
1267cf8bd2 Add some more missing basic testcases. 2010-04-21 19:45:33 +03:00
Ville Skyttä
38e9ef18b2 Fix leak of $arg from hcitool and cryptsetup completions. 2010-04-21 19:25:02 +03:00
Ville Skyttä
1017a085a9 Add bunch of missing basic testcases. 2010-04-21 19:20:35 +03:00
Ville Skyttä
807ddd4105 lzma groks *.tlz. 2010-04-21 19:12:05 +03:00
Ville Skyttä
e270eb18e3 Improve filesystem type completions. 2010-04-21 19:07:17 +03:00
Ville Skyttä
7fc1fa88a8 Fix handling of short xz options.
Was broken in 8f42adfa8d5e9fbbba9566d1b76d9f89667e6d98
2010-04-19 21:36:47 +03:00
Ville Skyttä
b19c948a95 Add basic xz tests. 2010-04-19 21:21:19 +03:00
Freddy Vulto
96a936443e (testsuite) Run tests for superuser commands only if command is available
Case was /usr/sbin/grub.
Added check to `assert_source_completions()' if command is really
available for current user.
2010-04-17 08:16:37 +02:00
Ville Skyttä
c89152b6b2 Drop unnecessary $TESTDIR from java -cp test. 2010-04-12 20:39:07 +03:00
Ville Skyttä
79b998442e Run tests based on installed completions, not just command availability.
http://lists.alioth.debian.org/pipermail/bash-completion-devel/2010-February/002556.html
2010-04-12 20:35:16 +03:00
Ville Skyttä
a44c07fb9e Add more iconv option completions, use _split_longopt. 2010-04-11 16:50:10 +03:00
Freddy Vulto
3d4941fa96 (testsuite) Add test case for _filedir with directory containing multibyte character.
See also: http://www.mail-archive.com/bash-completion-devel@lists.alioth.debian.org/msg01942.html
2010-04-10 12:13:33 +02:00
Freddy Vulto
bdca37a7bf Improve _get_comp_words_by_ref to return words' and cword'
Usage: _get_comp_words_by_ref [OPTIONS] [VARNAMES]
Available VARNAMES:
    cur         Return cur within varname "cur"
    prev        Return prev within varname "prev"
    words       Return words within varname "words"
    cword       Return cword within varname "cword"

Available OPTIONS:
    -n EXCLUDE  Characters out of $COMP_WORDBREAKS which should NOT be
                considered word breaks. This is useful for things like scp
                where we want to return host:path and not only path, so we
                would pass the colon (:) as -n option in this case.  Bash-3
                doesn't do word splitting, so this ensures we get the same
                word on both bash-3 and bash-4.
    -c VARNAME  Return cur within specified VARNAME
    -p VARNAME  Return prev within specified VARNAME
    -w VARNAME  Return words within specified VARNAME
    -i VARNAME  Return words within specified VARNAME

Example usage:

   $ _get_comp_words_by_ref -n : cur prev
2010-03-14 11:07:13 +01:00
Freddy Vulto
86ce86cb34 (testsuite) Add empty fixture directory 2010-03-13 09:10:31 +01:00
Freddy Vulto
caaf58859a Undo commit 00560a88 ("_filedir: bash > 4 has the same behaviour
regardless of $cur beginning with ' or not"), because this is failing
tests:

    FAIL: completing f a\'b/ should return i
    FAIL: completing f a\"b/ should return i
    FAIL: f a\$b/ should show completions
    FAIL: f a\\b/ should show completions
    FAIL: completing f2 a\'b/ should return i
    FAIL: completing f2 a\"b/ should return i
    FAIL: f2 a\$b/ should show completions
    FAIL: f2 a\\b/ should show completions

- Fix _filedir to check for availability of COMP_WORDS (_filedir runs from
  within a completion instead of the command line) when doing a `complete -p
  ${COMP_WORDS[0]'
- Fix _filedir usage comment
- Enhanced _filedir tests
- Added _filedir test "completing with filter '.e1' should show completions"
2010-03-12 13:41:53 +01:00
Crestez Dan Leonard
0f49bb1e3c (testsuite) Add a --timeout option to test/run to override the default expect timeout. 2010-02-21 05:44:39 +02:00
Crestez Dan Leonard
f9177e5286 (testsuite) Add a --debug-xtrace option to run.
Cleanup test/run scripts and add a --debug-xtrace option.
2010-02-20 22:54:13 +02:00
Ville Skyttä
59977e4bf8 Sync before unsetting var to avoid error message. 2010-02-15 18:56:09 +02:00
Crestez Dan Leonard
f294219990 Merge branch 'mount-fix'
Fix mount handling of escapes (Alioth: #311410, Launchpad: #219971)

Conflicts:
	CHANGES
2010-02-15 15:36:58 +02:00
Crestez Dan Leonard
91f7e8274e (mount) Handle escapes in LABEL= lines from fstab. 2010-02-15 15:33:10 +02:00
Freddy Vulto
99e550c3a8 (testsuite) fix indent/comment sync_after_int 2010-02-11 23:12:04 +01:00
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
Crestez Dan Leonard
4375c4b94e (mount) Split __linux_fstab_unescape function. Deal with \ at the end of strings. 2010-02-09 15:28:28 +02:00
Crestez Dan Leonard
2f61acd068 (mount) Make mount work properly with ' in fstab 2010-02-09 15:28:28 +02:00
Crestez Dan Leonard
c0b77a03f5 (mount) Make it clear that $' strings are not supported 2010-02-09 15:28:28 +02:00
Crestez Dan Leonard
6e0dc07ee2 (mount) Cleanup mount tests and test-fstab; fix obvious errors. 2010-02-09 15:28:13 +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
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
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
bfb55ddf32 (testsuite) mount.exp: Create a mount-line completion which reads from a file instead of global fstab. 2010-02-04 19:02:18 +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
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