53 Commits

Author SHA1 Message Date
Freddy Vulto
4467ce1725 Fix completion test for dpgk -L 2009-09-12 22:31:10 +02:00
Freddy Vulto
31f03cfb82 Fix for known_host files containing * character
Quote sed output ("\1") retrieving "GlobalKnownHostsFile/UserKnownHostsFile" to
prevent bash globbing of special characters, e.g. '*'.

Added unit test "Config file containing star (*) should work".
Added test library function `assert_bash_list()'.
To run unit tests:

    cd test && ./runUnit _known_hosts_real.exp
2009-08-23 09:38:19 +02:00
Freddy Vulto
9af88e6bd4 Fix unit test _known_hosts_real
Test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE" now
includes hosts reported by avahi.
2009-08-18 21:28:43 +02:00
Freddy Vulto
2e87bd4c01 Added setting COMP_KNOWN_HOSTS_WITH_HOSTFILE
`_known_hosts_real' will add hosts from HOSTFILE (compgen -A hostname), unless
`COMP_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value.

To run the unit tests:

   $ cd test && ./runUnit _known_hosts_real.exp
2009-08-12 22:20:56 +02:00
Freddy Vulto
466fc03e28 Add generate script for completion tests 2009-08-11 21:07:06 +02:00
Freddy Vulto
90fc7be011 Reviewed tests v*, w*, x* & y*
Directories `test/_completion_to_review' &
'lib/completions_to_review' are now removed.
2009-08-01 09:35:24 +02:00
Freddy Vulto
85dd9cd64c Reviewed tests u* 2009-07-31 22:53:30 +02:00
Freddy Vulto
bcd33375ca Reviewed tests t* 2009-07-31 22:18:12 +02:00
Freddy Vulto
567eb37802 Reviewed tests s* 2009-07-31 12:20:51 +02:00
Freddy Vulto
6d31b15011 Fix backwards compatibility calls to _known_hosts
This mimics the old behaviour where you could reuse `_known_hosts()' as
a helper function and pass it `-a' or `-c'.
NOTE: Using `_known_hosts' as a helper function and passing options to
`_known_hosts' is deprecated: Use `_known_hosts_real' instead.
2009-07-25 09:35:03 +02:00
Freddy Vulto
ddb0571227 Reviewed tests q* & r*
Added .swp (vim backup) files to .gitignore
2009-07-24 12:33:30 +02:00
Freddy Vulto
53b1c41c16 Reviewed tests p* 2009-07-24 11:58:02 +02:00
Freddy Vulto
285136a8df Reviewed tests o* 2009-07-24 11:20:38 +02:00
Freddy Vulto
890cadbc3a Reviewed tests n* 2009-07-24 11:16:03 +02:00
Freddy Vulto
0d443835c4 Reviewed tests m* 2009-07-24 09:55:54 +02:00
Freddy Vulto
9bb02ca317 Reviewed tests l* 2009-07-20 21:13:58 +02:00
Freddy Vulto
f1f61ace51 Reviewed tests j* & k* 2009-07-19 14:48:55 +02:00
Freddy Vulto
11302d4038 Reviewed tests h* & i*
Localized `i' variable in `info' completion.
2009-07-18 16:55:23 +02:00
Freddy Vulto
c6af1bf435 Reviewed tests g*
Removed excess parenthesis from gdb completion
2009-07-18 09:43:25 +02:00
Freddy Vulto
22675a60f7 Reviewed tests f* 2009-07-17 23:15:15 +02:00
Freddy Vulto
55bc44b035 Reviewed tests e*
Fixed `assert_complete()' to remove an optional (partial) argument from
`cmd' when expecting `cmd + longestCommonPrefix'.
Added `prompt' argument to procs `assert_bash_exec()' &
`sync_after_int()'
2009-07-17 16:15:02 +02:00
Freddy Vulto
f615d17cb6 tsuite) Only test completions if installed
Some tests failed with label `failed', which is incorrect because the
completions just weren't installed.  Completions weren't installed
because the commands to complete weren't installed.
Fixed so that if commands aren't available, the tests fail with label
`unsupported'.
2009-07-16 22:51:18 +02:00
Freddy Vulto
2d905413fb (testsuite) Removed local short timeout values
The local timeout settings `-timeout 1' in some loops seemed to cause
inpredictable results, e.g. with `./runCompletion dkpg.exp' since this
test has a long list to match.  Sometimes the `spawn_id' was gone before
the `teardown' method was called.
Removing the short timeout seems to give more predictable results.
2009-07-16 22:47:44 +02:00
Freddy Vulto
acdf4ca55e (testsuite) Improve `cancel' with dummy print job
A dummy print job is now created (and removed/cancelled) when testing `cancel' completion.
To run the test:

    cd test && ./runCompletion cancel.exp
2009-07-12 21:41:56 +02:00
Freddy Vulto
7cdd205e76 (testsuite) `assert_complete' uses common prefix
Fix `assert_complete' to expect the longest common prefix to be presented as completion.
When trying to do a:

    package require textutil::string

it appeared DejaGnu overwrites `unknown', the tcl function that is called to attempt autoloading.  A workaround is used for tcl auto-loading to work: `init.tcl' is reloaded to restore the original `unknown' function:

    source [file join [info library] init.tcl]

See also: http://fvue.nl/wiki/DejaGnu:_proc_"tclPkgUnknown_..."_does_not_exist
2009-07-12 21:37:57 +02:00
Freddy Vulto
262c91b486 [testsuite] Improved `match_items()' sorting
`match_items()' now uses bash sort instead of tcl lsort.
The difference in sorting happens because bash and tcl use a different sorting order:
* bash sort uses the current locale's collating sequence and character set
* tcl lsort uses a C-like sort order where each character is sorted according to its numeric value
See also: http://fvue.nl/wiki/Tcl:_Lsort_output_differs_from_bash_sort

This fix allows the `dpkg -L' test to compare all packages.  To run the test:

   ./runCompletion dpkg.exp
2009-07-10 23:08:11 +02:00
Freddy Vulto
3fe193f81a Fix completing multiple hosts (Debian: #535585)
Fixed `_known_hosts_real' to allow for multiple patterns in ssh config, e.g.:

    Host foo.example.net bar.example.net

IFS was set to just newline (\n), whereas `compgen -W' relies on IFS
being space-tab-newline ( \t\n) to expand hostnames which are separated
by whitespace.
Tests are updated as well (added host `jar' to config).  To run the tests:

    ./runUnit _known_hosts_real.exp
2009-07-07 23:05:03 +02:00
Freddy Vulto
25e4eb6df3 Gave _known_hosts_real mandatory argument CWORD
The option `-h hostname' to `_known_hosts_real' is removed.
2009-07-03 22:28:13 +02:00
Freddy Vulto
c769eeaf8c (testsuite) Centralized tcl function `get_hosts' 2009-06-19 14:56:36 +02:00
Freddy Vulto
49f739a515 Make finger test use new 'assert_complete_partial' 2009-06-19 14:47:34 +02:00
Freddy Vulto
67eedb203f Added ssh completion tests:
- First argument shouldn't complete with commands
- Tab should complete partial hostname

To run the tests: $ cd test && ./runCompletion ssh.exp

Added test library function: assert_complete_partial
2009-06-19 14:23:57 +02:00
Freddy Vulto
362090a160 Updated test _known_hosts_real.
Added hosts retrieved by avahi-browse.
2009-06-19 12:33:50 +02:00
Freddy Vulto
043fe4dd4b Reviewed tests d* 2009-06-15 23:17:39 +02:00
Freddy Vulto
881bce9618 Reviewed tests b* & c* 2009-06-14 16:22:25 +02:00
Freddy Vulto
3d723502c9 Reviewed tests a* 2009-06-14 15:20:38 +02:00
Freddy Vulto
ad1b60a3de Refactored xhost & alias completion tests 2009-06-14 13:15:06 +02:00
Freddy Vulto
33118de1f6 Refactored finger test 2009-06-14 12:18:24 +02:00
Freddy Vulto
1f63e21ff5 Fix _user_at_host completion
Fixed _known_hosts_real user completion.
Added test for `finger'.  To execute:

    $ cd test && ./runCompletion finger.exp
2009-06-13 11:34:39 +02:00
Freddy Vulto
b1d869cbf2 Renamed unit test _known_hosts > _known_hosts_real 2009-06-13 08:42:22 +02:00
Freddy Vulto
0b19577ed9 Added -h HOST option to _known_hosts_real
Modified call to _known_hosts_real in ssh, vncviewer and xhost completions.
2009-06-13 08:38:52 +02:00
Freddy Vulto
67c3ea26e7 Added xhost test
To run the test:

    $ cd test
    $ ./runCompletion xhost.exp
2009-06-12 11:47:28 +02:00
Freddy Vulto
cd2b62bd62 Fix quotes _known_hosts calling _known_hosts_real
This fixes test "Config file containing space should work".  See test:

   ./runUnit _known_hosts.exp
2009-06-11 21:26:43 +02:00
Freddy Vulto
579e462a6f Add missing directories to test/fixture1 2009-06-10 00:27:27 +02:00
Freddy Vulto
dd5502a920 Upgraded tests for cd and mplayer (and vncviewers) 2009-06-10 00:13:19 +02:00
Freddy Vulto
9e4d9b9653 Moved vncviewer tests out of to_review 2009-06-10 00:00:27 +02:00
Freddy Vulto
b74997084e Added unit test for _get_cword 2009-06-09 23:52:47 +02:00
Freddy Vulto
22499819a1 Moved 'alias' tests out of 'to_review'.
Directory 'completion_to_review' is now really removed (prefixed with _)
from previous commit.
2009-06-09 23:26:45 +02:00
Freddy Vulto
61e5b57eb7 Prefix dir 'completion_to_review' with _
This prevents the command ./runCompletion from running the tests in the
'completion_to_review' directory.
2009-06-09 23:18:59 +02:00
Freddy Vulto
acfacb0c00 Moved vncviewer tests out of 'to_review' 2009-06-09 23:17:38 +02:00
Freddy Vulto
ad123d1b63 Test suite files of bash-completion-lib
They need minor modifications/upgrading and can then be moved to the
directory without the '_to_review' suffix.
2009-06-09 23:04:43 +02:00