From 0f18d2327aaf017b0accd14d388b21d50e6ef508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 7 Jul 2009 18:47:33 +0300 Subject: [PATCH 01/69] Add xmlwf completion. --- CHANGES | 1 + Makefile.am | 1 + contrib/xmlwf | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 contrib/xmlwf diff --git a/CHANGES b/CHANGES index 91a7736b..1956f53b 100644 --- a/CHANGES +++ b/CHANGES @@ -92,6 +92,7 @@ bash-completion (1.x) to get various completions instead of simply "mplayer" or "mencoder". * Associate OOXML/MS Office 2007 extensions with OpenOffice applications. * Associate .tsv with oocalc. + * Add xmlwf completion. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/Makefile.am b/Makefile.am index 56ae5ac9..3c808914 100644 --- a/Makefile.am +++ b/Makefile.am @@ -137,6 +137,7 @@ bashcomp_DATA = contrib/ant \ contrib/xhost \ contrib/xm \ contrib/xmllint \ + contrib/xmlwf \ contrib/xmms \ contrib/xrandr \ contrib/yp-tools \ diff --git a/contrib/xmlwf b/contrib/xmlwf new file mode 100644 index 00000000..97e9bbd8 --- /dev/null +++ b/contrib/xmlwf @@ -0,0 +1,35 @@ +# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*- +# ex: ts=8 sw=8 noet filetype=sh +# +# bash completion for xmlwf(1) + +have xmlwf && +_xmlwf() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -d) + _filedir -d + return 0 + ;; + -e) + COMPREPLY=( $( compgen -W 'US-ASCII UTF-8 UTF-16 \ + ISO-8859-1' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-c -d -e -m -n -p -r -s -t -v -w \ + -x' -- $cur ) ) + return 0 + fi + + _filedir '@(*ml|htm|svg)' +} && +complete -F _xmlwf $filenames xmlwf From 0c44194be2bfbd39a9f9fd15149356f088e70ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 7 Jul 2009 18:50:56 +0300 Subject: [PATCH 02/69] Improve xmllint --dtdvalid, --relaxng, --schema and --schematron completions. --- contrib/xmllint | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/contrib/xmllint b/contrib/xmllint index e643611f..59d75704 100644 --- a/contrib/xmllint +++ b/contrib/xmllint @@ -17,8 +17,24 @@ _xmllint() _filedir return 0 ;; - --path|--dtdvalid|--dtdvalidfpi|--maxmem|--encode|--pattern|\ - --relaxng|--schema|--schematron) + --path|--dtdvalidfpi|--maxmem|--encode|--pattern) + # argument required but no completions available + return 0 + ;; + --dtdvalid) + _filedir dtd + return 0 + ;; + --relaxng) + _filedir rng + return 0 + ;; + --schema) + _filedir xsd + return 0 + ;; + --schematron) + _filedir sch return 0 ;; esac From 3fe193f81a3e708d3f235e670ba0c1a9050a1a18 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Tue, 7 Jul 2009 23:02:27 +0200 Subject: [PATCH 03/69] 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 --- bash_completion | 3 ++- test/fixtures/_known_hosts_real/config | 2 +- test/unit/_known_hosts_real.exp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bash_completion b/bash_completion index e38dca73..83510144 100644 --- a/bash_completion +++ b/bash_completion @@ -1069,7 +1069,6 @@ _known_hosts_real() local configfile flag prefix local cur curd awkcur user suffix aliases global_kh user_kh hosts i host local -a kh khd config - local IFS=$'\n' local OPTIND=1 while getopts "acF:p:" flag "$@"; do @@ -1102,6 +1101,7 @@ _known_hosts_real() fi if [ ${#config[@]} -gt 0 ]; then + local OIFS=$IFS IFS=$'\n' # expand path (if present) to global known hosts file global_kh=($( sed -ne 's/^[ \t]*[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" )) for (( i=0; i < ${#global_kh[@]}; i++ )); do @@ -1112,6 +1112,7 @@ _known_hosts_real() for (( i=0; i < ${#user_kh[@]}; i++ )); do user_kh[i]=$(echo "${user_kh[i]//\"/}") done + IFS=$OIFS fi # Global known_hosts files diff --git a/test/fixtures/_known_hosts_real/config b/test/fixtures/_known_hosts_real/config index 9b9da437..77770ffe 100644 --- a/test/fixtures/_known_hosts_real/config +++ b/test/fixtures/_known_hosts_real/config @@ -1,6 +1,6 @@ UserKnownHostsFile fixtures/_known_hosts_real/known_hosts # Unindented -Host gee +Host gee jar # Indented Host hus # With comment diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp index 9acd7b61..a698b926 100644 --- a/test/unit/_known_hosts_real.exp +++ b/test/unit/_known_hosts_real.exp @@ -13,9 +13,9 @@ setup set test "Hosts should be put in COMPREPLY" set hosts [get_hosts] - # Hosts `gee' and `hus' are defined in ./fixtures/_known_hosts_real/config + # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config # Hosts `doo' and `ike' are defined in ./fixtures/_known_hosts_real/known_hosts -lappend hosts doo gee hus ike +lappend hosts doo gee hus ike jar set hosts [lsort -ascii $hosts] set hosts [join $hosts "\\s+"] # Call _known_hosts From 262c91b4867b23f50e683eacbc8163d3b75d752c Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 10 Jul 2009 23:08:11 +0200 Subject: [PATCH 04/69] [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 --- test/lib/completions/dpkg.exp | 14 ++++++-------- test/lib/library.exp | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/test/lib/completions/dpkg.exp b/test/lib/completions/dpkg.exp index fe6d1c1c..ff4c5274 100644 --- a/test/lib/completions/dpkg.exp +++ b/test/lib/completions/dpkg.exp @@ -21,14 +21,12 @@ sync_after_int # NOTE: If an argument is passed to `--get-selections', `dpkg' also returns # packages with status "purged". Be sure to add `| grep install$' to # pipeline before 'cut' in that case. -- FVu, Sun Feb 22 10:08:34 CET 2009 - # TODO: Fix sorting in `match_items' in lib/library.exp. Sorting in tcl appears - # to be different from sorting in bash. -#if {[assert_exec {dpkg --get-selections | cut -f1 | sort} packages]} { -# assert_complete $packages "dpkg -L " -#}; # if -# -# -#sync_after_int +if {[assert_exec {dpkg --get-selections | cut -f1} packages]} { + assert_complete $packages "dpkg -L " +}; # if + + +sync_after_int teardown diff --git a/test/lib/library.exp b/test/lib/library.exp index 7147980e..352d892a 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -231,7 +231,7 @@ proc get_hosts {} { # @param integer $size Chunk size # @result boolean True if successful, False if not proc match_items {items test {size 20}} { - set items [lsort -ascii $items] + set items [exec sort << [join $items "\n"]] set result false for {set i 0} {$i < [llength $items]} {set i [expr {$i + $size}]} { set expected "" From 7cdd205e76d5afd94d1e8342be4fa3895ec6ff36 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sun, 12 Jul 2009 21:37:57 +0200 Subject: [PATCH 05/69] (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 --- test/lib/library.exp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/lib/library.exp b/test/lib/library.exp index 352d892a..b152ffb5 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -1,3 +1,11 @@ + # Source `init.tcl' again to restore the `unknown' procedure + # NOTE: DejaGnu has an old `unknown' procedure which unfortunately disables + # tcl auto-loading. +source [file join [info library] init.tcl] +package require textutil::string + + + # Execute a bash command and make sure the exit status is succesful. # If not, output the error message. # @param string $cmd Bash command line to execute. If emptry string (""), the @@ -70,8 +78,9 @@ proc assert_complete {expected cmd {test ""} {prompt /@} {size 20}} { if {[llength $expected] == 1} { pass "$test" } else { + set common [::textutil::string::longestCommonPrefixList $expected] expect { - -ex "$prompt$cmd" { pass "$test" } + -ex "$prompt$cmd$common" { pass "$test" } -re $prompt { unresolved "$test at prompt" } -re eof { unresolved "eof" } }; # expect From acdf4ca55e8018b0a275940541822d53f13741b1 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sun, 12 Jul 2009 21:41:56 +0200 Subject: [PATCH 06/69] (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 --- test/fixture1/foo | 1 + test/lib/completions/cancel.exp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test/fixture1/foo b/test/fixture1/foo index e69de29b..257cc564 100644 --- a/test/fixture1/foo +++ b/test/fixture1/foo @@ -0,0 +1 @@ +foo diff --git a/test/lib/completions/cancel.exp b/test/lib/completions/cancel.exp index 7ba79daf..ac41c282 100644 --- a/test/lib/completions/cancel.exp +++ b/test/lib/completions/cancel.exp @@ -11,7 +11,18 @@ proc teardown {} { setup -assert_complete_any "cancel " + # Adding a print job is successful? +if {[assert_exec {lp -H hold fixture1/foo} job]} { + # Yes, adding a print-job is successful; + # Retrieve job-id, so we can cancel the job after the test + set job_id [lindex [split $job] 3] + # Retrieve list of all current print jobs + assert_exec {lpstat | cut -d\040 -f1} jobs + # Completion should show all print jobs + assert_complete $jobs "cancel " + # Remove/cancel the test print job + assert_exec "cancel $job_id" +}; # if sync_after_int From e34f96e50ddd88599d57ffcb293ba52641946b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 13 Jul 2009 18:28:42 +0300 Subject: [PATCH 07/69] Associate *.po with poedit, gtranslator, kbabel, and lokalize. --- CHANGES | 1 + bash_completion | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 1956f53b..a7179f5e 100644 --- a/CHANGES +++ b/CHANGES @@ -93,6 +93,7 @@ bash-completion (1.x) * Associate OOXML/MS Office 2007 extensions with OpenOffice applications. * Associate .tsv with oocalc. * Add xmlwf completion. + * Associate *.po with poedit, gtranslator, kbabel, and lokalize. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/bash_completion b/bash_completion index 83510144..f1ccb202 100644 --- a/bash_completion +++ b/bash_completion @@ -144,6 +144,7 @@ complete -f -X '!*.odb' oobase complete -f -X '!*.rpm' rpm2cpio complete -f -X '!*.sqlite' sqlite3 complete -f -X '!*.aux' bibtex +complete -f -X '!*.po' poedit gtranslator kbabel lokalize # FINISH exclude -- do not remove this line # start of section containing compspecs that can be handled within bash From cbe81a50dad02baf4032b1bfe663eb39bc806743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 Jul 2009 21:11:48 +0300 Subject: [PATCH 08/69] Add link to Ubuntu bug about disabling database and user completions. --- contrib/postgresql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/postgresql b/contrib/postgresql index 98601c5e..e3b8574c 100644 --- a/contrib/postgresql +++ b/contrib/postgresql @@ -6,7 +6,7 @@ have psql && { _pg_databases() { - return # intentionally disabled in 7ebed6af (TODO: why?) + return # See https://launchpad.net/bugs/164772 COMPREPLY=( $( compgen -W "$( psql -l 2>/dev/null | \ sed -e '1,/^-/d' -e '/^(/,$d' | \ awk '{print $1}' )" -- $cur ) ) @@ -14,6 +14,7 @@ _pg_databases() _pg_users() { + # See https://launchpad.net/bugs/164772 #COMPREPLY=( $( psql -qtc 'select usename from pg_user' template1 2>/dev/null | \ # grep "^ $cur" ) ) #[ ${#COMPREPLY[@]} -eq 0 ] && COMPREPLY=( $( compgen -u -- $cur ) ) From c6e916bece4df02979889b4d15bdb712bfc84b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 Jul 2009 21:13:43 +0300 Subject: [PATCH 09/69] Add reference to Ubuntu bug about disabling PostgreSQL database and user completions. --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index a7179f5e..59131021 100644 --- a/CHANGES +++ b/CHANGES @@ -347,7 +347,7 @@ bash-completion (20080617.4) experimental; urgency=low - _known_hosts(): use files from UserKnownHostsFile options in addition to standard ones. - fixed _command() to correctly prune the command line - - disabled completion of PostgreSQL users and databases + - disabled completion of PostgreSQL users and databases (Ubuntu: #164772) - fixed _java_packages() - fixed _muttquery() - added flv/FLV completion to mplayer From 2d905413fb676d22da075f26cdc2826ddb6b8781 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Thu, 16 Jul 2009 22:47:44 +0200 Subject: [PATCH 10/69] (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. --- test/lib/library.exp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/lib/library.exp b/test/lib/library.exp index b152ffb5..f6f56361 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -125,10 +125,7 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} { expect -ex "$cmd" # Escape special regexp characters regsub -all {([\[\]\(\)\.\\\+])} $cmd {\\\1} cmd - # NOTE: A timeout of 1 is used to match quicker when no completion are - # returned. E.g. within `cancel.exp' when no print jobs are available. expect { - -timeout 1 -re "^\r\n.*$prompt$cmd$" { pass "$test" } -re /@ { unresolved "$test at prompt" } -re eof { unresolved "eof" } @@ -253,7 +250,6 @@ proc match_items {items test {size 20}} { }; # for if {[llength $items] == 1} { expect { - -timeout 1 -re "$expected" { set result true } "\r\n" { set result false; break } default { set result false; break } @@ -261,7 +257,6 @@ proc match_items {items test {size 20}} { }; # expect } else { expect { - -timeout 1 -re "$expected" { set result true } default { set result false; break } timeout { set result false; break } From f615d17cb6c354c7dbb5678618fc1a22e3cab24f Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Thu, 16 Jul 2009 22:51:18 +0200 Subject: [PATCH 11/69] 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'. --- test/completion/change_pw.exp | 4 +++- test/completion/check_db.exp | 4 +++- test/completion/check_perms.exp | 4 +++- test/completion/civclient.exp | 4 +++- test/completion/civserver.exp | 4 +++- test/completion/cksfv.exp | 4 +++- test/completion/cleanarch.exp | 4 +++- test/completion/clone_member.exp | 4 +++- test/completion/config_list.exp | 4 +++- 9 files changed, 27 insertions(+), 9 deletions(-) diff --git a/test/completion/change_pw.exp b/test/completion/change_pw.exp index c1a996b3..2a1334c5 100644 --- a/test/completion/change_pw.exp +++ b/test/completion/change_pw.exp @@ -1 +1,3 @@ -source "lib/completions/change_pw.exp" +if {[assert_bash_type {change_pw}]} { + source "lib/completions/change_pw.exp" +}; # if diff --git a/test/completion/check_db.exp b/test/completion/check_db.exp index 19bc9fc6..09fddb29 100644 --- a/test/completion/check_db.exp +++ b/test/completion/check_db.exp @@ -1 +1,3 @@ -source "lib/completions/check_db.exp" +if {[assert_bash_type {check_db}]} { + source "lib/completions/check_db.exp" +}; # if diff --git a/test/completion/check_perms.exp b/test/completion/check_perms.exp index e664246c..a7b9d2d3 100644 --- a/test/completion/check_perms.exp +++ b/test/completion/check_perms.exp @@ -1 +1,3 @@ -source "lib/completions/check_perms.exp" +if {[assert_bash_type {check_perms}]} { + source "lib/completions/check_perms.exp" +}; # if diff --git a/test/completion/civclient.exp b/test/completion/civclient.exp index 933ec8ef..45eeb3f2 100644 --- a/test/completion/civclient.exp +++ b/test/completion/civclient.exp @@ -1 +1,3 @@ -source "lib/completions/civclient.exp" +if {[assert_bash_type {civclient}]} { + source "lib/completions/civclient.exp" +}; # if diff --git a/test/completion/civserver.exp b/test/completion/civserver.exp index a3eb4a5c..f16419fd 100644 --- a/test/completion/civserver.exp +++ b/test/completion/civserver.exp @@ -1 +1,3 @@ -source "lib/completions/civserver.exp" +if {[assert_bash_type {civserver}]} { + source "lib/completions/civserver.exp" +}; # if diff --git a/test/completion/cksfv.exp b/test/completion/cksfv.exp index 12e398ee..b7fc9088 100644 --- a/test/completion/cksfv.exp +++ b/test/completion/cksfv.exp @@ -1 +1,3 @@ -source "lib/completions/cksfv.exp" +if {[assert_bash_type {cksfv}]} { + source "lib/completions/cksfv.exp" +}; # if diff --git a/test/completion/cleanarch.exp b/test/completion/cleanarch.exp index e7efa8bc..925ab607 100644 --- a/test/completion/cleanarch.exp +++ b/test/completion/cleanarch.exp @@ -1 +1,3 @@ -source "lib/completions/cleanarch.exp" +if {[assert_bash_type {cleanarch}]} { + source "lib/completions/cleanarch.exp" +}; # if diff --git a/test/completion/clone_member.exp b/test/completion/clone_member.exp index f2c7fa00..f8d10fa9 100644 --- a/test/completion/clone_member.exp +++ b/test/completion/clone_member.exp @@ -1 +1,3 @@ -source "lib/completions/clone_member.exp" +if {[assert_bash_type {clone_member}]} { + source "lib/completions/clone_member.exp" +}; # if diff --git a/test/completion/config_list.exp b/test/completion/config_list.exp index d014f572..749e7faa 100644 --- a/test/completion/config_list.exp +++ b/test/completion/config_list.exp @@ -1 +1,3 @@ -source "lib/completions/config_list.exp" +if {[assert_bash_type {config_list}]} { + source "lib/completions/config_list.exp" +}; # if From 55bc44b03514c6450ee8eea2de6369249e6846e0 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 17 Jul 2009 16:15:02 +0200 Subject: [PATCH 12/69] 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()' --- test/_completion_to_review/enscript.exp | 1 - test/_completion_to_review/env.exp | 1 - test/_completion_to_review/evince.exp | 12 ------- test/_completion_to_review/expand.exp | 1 - test/completion/enscript.exp | 3 ++ test/completion/env.exp | 3 ++ test/completion/evince.exp | 1 + test/completion/expand.exp | 3 ++ test/fixtures/evince/.BMP | 0 test/fixtures/evince/.CBR | 0 test/fixtures/evince/.CBZ | 0 test/fixtures/evince/.DJV | 0 test/fixtures/evince/.DJVU | 0 test/fixtures/evince/.DVI | 0 test/fixtures/evince/.DVI.BZ2 | 0 test/fixtures/evince/.DVI.GZ | 0 test/fixtures/evince/.DVI.bz2 | 0 test/fixtures/evince/.DVI.gz | 0 test/fixtures/evince/.EPS | 0 test/fixtures/evince/.EPS.BZ2 | 0 test/fixtures/evince/.EPS.GZ | 0 test/fixtures/evince/.EPS.bz2 | 0 test/fixtures/evince/.EPS.gz | 0 test/fixtures/evince/.GIF | 0 test/fixtures/evince/.ICO | 0 test/fixtures/evince/.JPEG | 0 test/fixtures/evince/.JPG | 0 test/fixtures/evince/.MIFF | 0 test/fixtures/evince/.PBM | 0 test/fixtures/evince/.PCX | 0 test/fixtures/evince/.PDF | 0 test/fixtures/evince/.PDF.BZ2 | 0 test/fixtures/evince/.PDF.GZ | 0 test/fixtures/evince/.PDF.bz2 | 0 test/fixtures/evince/.PDF.gz | 0 test/fixtures/evince/.PGM | 0 test/fixtures/evince/.PNG | 0 test/fixtures/evince/.PNM | 0 test/fixtures/evince/.PPM | 0 test/fixtures/evince/.PS | 0 test/fixtures/evince/.PS.BZ2 | 0 test/fixtures/evince/.PS.GZ | 0 test/fixtures/evince/.PS.bz2 | 0 test/fixtures/evince/.PS.gz | 0 test/fixtures/evince/.TGA | 0 test/fixtures/evince/.TIF | 0 test/fixtures/evince/.TIFF | 0 test/fixtures/evince/.XPM | 0 test/fixtures/evince/.XWD | 0 test/fixtures/evince/.bmp | 0 test/fixtures/evince/.cbr | 0 test/fixtures/evince/.cbz | 0 test/fixtures/evince/.djv | 0 test/fixtures/evince/.djvu | 0 test/fixtures/evince/.dvi | 0 test/fixtures/evince/.dvi.BZ2 | 0 test/fixtures/evince/.dvi.GZ | 0 test/fixtures/evince/.dvi.bz2 | 0 test/fixtures/evince/.dvi.gz | 0 test/fixtures/evince/.eps | 0 test/fixtures/evince/.eps.BZ2 | 0 test/fixtures/evince/.eps.GZ | 0 test/fixtures/evince/.eps.bz2 | 0 test/fixtures/evince/.eps.gz | 0 test/fixtures/evince/.gif | 0 test/fixtures/evince/.ico | 0 test/fixtures/evince/.jpeg | 0 test/fixtures/evince/.jpg | 0 test/fixtures/evince/.miff | 0 test/fixtures/evince/.pbm | 0 test/fixtures/evince/.pcx | 0 test/fixtures/evince/.pdf | 0 test/fixtures/evince/.pdf.BZ2 | 0 test/fixtures/evince/.pdf.GZ | 0 test/fixtures/evince/.pdf.bz2 | 0 test/fixtures/evince/.pdf.gz | 0 test/fixtures/evince/.pgm | 0 test/fixtures/evince/.png | 0 test/fixtures/evince/.pnm | 0 test/fixtures/evince/.ppm | 0 test/fixtures/evince/.ps | 0 test/fixtures/evince/.ps.BZ2 | 0 test/fixtures/evince/.ps.GZ | 0 test/fixtures/evince/.ps.bz2 | 0 test/fixtures/evince/.ps.gz | 0 test/fixtures/evince/.tga | 0 test/fixtures/evince/.tif | 0 test/fixtures/evince/.tiff | 0 test/fixtures/evince/.txt | 0 test/fixtures/evince/.xpm | 0 test/fixtures/evince/.xwd | 0 test/lib/completions/enscript.exp | 20 +++++++++++ test/lib/completions/env.exp | 20 +++++++++++ test/lib/completions/evince.exp | 33 ++++++++++++++++++ test/lib/completions/expand.exp | 20 +++++++++++ test/lib/completions/finger.exp | 6 ++-- test/lib/completions_to_review/enscript.exp | 26 -------------- test/lib/completions_to_review/env.exp | 31 ----------------- test/lib/completions_to_review/evince.exp | 32 ----------------- test/lib/completions_to_review/expand.exp | 26 -------------- test/lib/library.exp | 38 +++++++++++++++------ 101 files changed, 133 insertions(+), 144 deletions(-) delete mode 100644 test/_completion_to_review/enscript.exp delete mode 100644 test/_completion_to_review/env.exp delete mode 100644 test/_completion_to_review/evince.exp delete mode 100644 test/_completion_to_review/expand.exp create mode 100644 test/completion/enscript.exp create mode 100644 test/completion/env.exp create mode 100644 test/completion/evince.exp create mode 100644 test/completion/expand.exp create mode 100644 test/fixtures/evince/.BMP create mode 100644 test/fixtures/evince/.CBR create mode 100644 test/fixtures/evince/.CBZ create mode 100644 test/fixtures/evince/.DJV create mode 100644 test/fixtures/evince/.DJVU create mode 100644 test/fixtures/evince/.DVI create mode 100644 test/fixtures/evince/.DVI.BZ2 create mode 100644 test/fixtures/evince/.DVI.GZ create mode 100644 test/fixtures/evince/.DVI.bz2 create mode 100644 test/fixtures/evince/.DVI.gz create mode 100644 test/fixtures/evince/.EPS create mode 100644 test/fixtures/evince/.EPS.BZ2 create mode 100644 test/fixtures/evince/.EPS.GZ create mode 100644 test/fixtures/evince/.EPS.bz2 create mode 100644 test/fixtures/evince/.EPS.gz create mode 100644 test/fixtures/evince/.GIF create mode 100644 test/fixtures/evince/.ICO create mode 100644 test/fixtures/evince/.JPEG create mode 100644 test/fixtures/evince/.JPG create mode 100644 test/fixtures/evince/.MIFF create mode 100644 test/fixtures/evince/.PBM create mode 100644 test/fixtures/evince/.PCX create mode 100644 test/fixtures/evince/.PDF create mode 100644 test/fixtures/evince/.PDF.BZ2 create mode 100644 test/fixtures/evince/.PDF.GZ create mode 100644 test/fixtures/evince/.PDF.bz2 create mode 100644 test/fixtures/evince/.PDF.gz create mode 100644 test/fixtures/evince/.PGM create mode 100644 test/fixtures/evince/.PNG create mode 100644 test/fixtures/evince/.PNM create mode 100644 test/fixtures/evince/.PPM create mode 100644 test/fixtures/evince/.PS create mode 100644 test/fixtures/evince/.PS.BZ2 create mode 100644 test/fixtures/evince/.PS.GZ create mode 100644 test/fixtures/evince/.PS.bz2 create mode 100644 test/fixtures/evince/.PS.gz create mode 100644 test/fixtures/evince/.TGA create mode 100644 test/fixtures/evince/.TIF create mode 100644 test/fixtures/evince/.TIFF create mode 100644 test/fixtures/evince/.XPM create mode 100644 test/fixtures/evince/.XWD create mode 100644 test/fixtures/evince/.bmp create mode 100644 test/fixtures/evince/.cbr create mode 100644 test/fixtures/evince/.cbz create mode 100644 test/fixtures/evince/.djv create mode 100644 test/fixtures/evince/.djvu create mode 100644 test/fixtures/evince/.dvi create mode 100644 test/fixtures/evince/.dvi.BZ2 create mode 100644 test/fixtures/evince/.dvi.GZ create mode 100644 test/fixtures/evince/.dvi.bz2 create mode 100644 test/fixtures/evince/.dvi.gz create mode 100644 test/fixtures/evince/.eps create mode 100644 test/fixtures/evince/.eps.BZ2 create mode 100644 test/fixtures/evince/.eps.GZ create mode 100644 test/fixtures/evince/.eps.bz2 create mode 100644 test/fixtures/evince/.eps.gz create mode 100644 test/fixtures/evince/.gif create mode 100644 test/fixtures/evince/.ico create mode 100644 test/fixtures/evince/.jpeg create mode 100644 test/fixtures/evince/.jpg create mode 100644 test/fixtures/evince/.miff create mode 100644 test/fixtures/evince/.pbm create mode 100644 test/fixtures/evince/.pcx create mode 100644 test/fixtures/evince/.pdf create mode 100644 test/fixtures/evince/.pdf.BZ2 create mode 100644 test/fixtures/evince/.pdf.GZ create mode 100644 test/fixtures/evince/.pdf.bz2 create mode 100644 test/fixtures/evince/.pdf.gz create mode 100644 test/fixtures/evince/.pgm create mode 100644 test/fixtures/evince/.png create mode 100644 test/fixtures/evince/.pnm create mode 100644 test/fixtures/evince/.ppm create mode 100644 test/fixtures/evince/.ps create mode 100644 test/fixtures/evince/.ps.BZ2 create mode 100644 test/fixtures/evince/.ps.GZ create mode 100644 test/fixtures/evince/.ps.bz2 create mode 100644 test/fixtures/evince/.ps.gz create mode 100644 test/fixtures/evince/.tga create mode 100644 test/fixtures/evince/.tif create mode 100644 test/fixtures/evince/.tiff create mode 100644 test/fixtures/evince/.txt create mode 100644 test/fixtures/evince/.xpm create mode 100644 test/fixtures/evince/.xwd create mode 100644 test/lib/completions/enscript.exp create mode 100644 test/lib/completions/env.exp create mode 100644 test/lib/completions/evince.exp create mode 100644 test/lib/completions/expand.exp delete mode 100644 test/lib/completions_to_review/enscript.exp delete mode 100644 test/lib/completions_to_review/env.exp delete mode 100644 test/lib/completions_to_review/evince.exp delete mode 100644 test/lib/completions_to_review/expand.exp diff --git a/test/_completion_to_review/enscript.exp b/test/_completion_to_review/enscript.exp deleted file mode 100644 index b10236b0..00000000 --- a/test/_completion_to_review/enscript.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/enscript.exp" diff --git a/test/_completion_to_review/env.exp b/test/_completion_to_review/env.exp deleted file mode 100644 index cc47ea19..00000000 --- a/test/_completion_to_review/env.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/env.exp" diff --git a/test/_completion_to_review/evince.exp b/test/_completion_to_review/evince.exp deleted file mode 100644 index 3df860ee..00000000 --- a/test/_completion_to_review/evince.exp +++ /dev/null @@ -1,12 +0,0 @@ -set test "Completion via _filedir_xspec() should be installed" -set cmd "complete -p evince" -send "$cmd\r" - -set expected "^$cmd\r\ncomplete -o filenames -F _filedir_xspec evince\r\n/@$" -expect { - -re $expected { pass "$test" } - -re /@ { fail "$test at prompt" } -}; # expect - - -source "lib/completions/evince.exp" diff --git a/test/_completion_to_review/expand.exp b/test/_completion_to_review/expand.exp deleted file mode 100644 index 55eec5ab..00000000 --- a/test/_completion_to_review/expand.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/expand.exp" diff --git a/test/completion/enscript.exp b/test/completion/enscript.exp new file mode 100644 index 00000000..ec6d75cb --- /dev/null +++ b/test/completion/enscript.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {enscript}]} { + source "lib/completions/enscript.exp" +}; # if diff --git a/test/completion/env.exp b/test/completion/env.exp new file mode 100644 index 00000000..a96c0535 --- /dev/null +++ b/test/completion/env.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {env}]} { + source "lib/completions/env.exp" +}; # if diff --git a/test/completion/evince.exp b/test/completion/evince.exp new file mode 100644 index 00000000..24815d58 --- /dev/null +++ b/test/completion/evince.exp @@ -0,0 +1 @@ +source "lib/completions/evince.exp" diff --git a/test/completion/expand.exp b/test/completion/expand.exp new file mode 100644 index 00000000..783069d7 --- /dev/null +++ b/test/completion/expand.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {expand}]} { + source "lib/completions/expand.exp" +}; # if diff --git a/test/fixtures/evince/.BMP b/test/fixtures/evince/.BMP new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.CBR b/test/fixtures/evince/.CBR new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.CBZ b/test/fixtures/evince/.CBZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.DJV b/test/fixtures/evince/.DJV new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.DJVU b/test/fixtures/evince/.DJVU new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.DVI b/test/fixtures/evince/.DVI new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.DVI.BZ2 b/test/fixtures/evince/.DVI.BZ2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.DVI.GZ b/test/fixtures/evince/.DVI.GZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.DVI.bz2 b/test/fixtures/evince/.DVI.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.DVI.gz b/test/fixtures/evince/.DVI.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.EPS b/test/fixtures/evince/.EPS new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.EPS.BZ2 b/test/fixtures/evince/.EPS.BZ2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.EPS.GZ b/test/fixtures/evince/.EPS.GZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.EPS.bz2 b/test/fixtures/evince/.EPS.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.EPS.gz b/test/fixtures/evince/.EPS.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.GIF b/test/fixtures/evince/.GIF new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.ICO b/test/fixtures/evince/.ICO new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.JPEG b/test/fixtures/evince/.JPEG new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.JPG b/test/fixtures/evince/.JPG new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.MIFF b/test/fixtures/evince/.MIFF new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PBM b/test/fixtures/evince/.PBM new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PCX b/test/fixtures/evince/.PCX new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PDF b/test/fixtures/evince/.PDF new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PDF.BZ2 b/test/fixtures/evince/.PDF.BZ2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PDF.GZ b/test/fixtures/evince/.PDF.GZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PDF.bz2 b/test/fixtures/evince/.PDF.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PDF.gz b/test/fixtures/evince/.PDF.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PGM b/test/fixtures/evince/.PGM new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PNG b/test/fixtures/evince/.PNG new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PNM b/test/fixtures/evince/.PNM new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PPM b/test/fixtures/evince/.PPM new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PS b/test/fixtures/evince/.PS new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PS.BZ2 b/test/fixtures/evince/.PS.BZ2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PS.GZ b/test/fixtures/evince/.PS.GZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PS.bz2 b/test/fixtures/evince/.PS.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.PS.gz b/test/fixtures/evince/.PS.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.TGA b/test/fixtures/evince/.TGA new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.TIF b/test/fixtures/evince/.TIF new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.TIFF b/test/fixtures/evince/.TIFF new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.XPM b/test/fixtures/evince/.XPM new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.XWD b/test/fixtures/evince/.XWD new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.bmp b/test/fixtures/evince/.bmp new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.cbr b/test/fixtures/evince/.cbr new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.cbz b/test/fixtures/evince/.cbz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.djv b/test/fixtures/evince/.djv new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.djvu b/test/fixtures/evince/.djvu new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.dvi b/test/fixtures/evince/.dvi new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.dvi.BZ2 b/test/fixtures/evince/.dvi.BZ2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.dvi.GZ b/test/fixtures/evince/.dvi.GZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.dvi.bz2 b/test/fixtures/evince/.dvi.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.dvi.gz b/test/fixtures/evince/.dvi.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.eps b/test/fixtures/evince/.eps new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.eps.BZ2 b/test/fixtures/evince/.eps.BZ2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.eps.GZ b/test/fixtures/evince/.eps.GZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.eps.bz2 b/test/fixtures/evince/.eps.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.eps.gz b/test/fixtures/evince/.eps.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.gif b/test/fixtures/evince/.gif new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.ico b/test/fixtures/evince/.ico new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.jpeg b/test/fixtures/evince/.jpeg new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.jpg b/test/fixtures/evince/.jpg new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.miff b/test/fixtures/evince/.miff new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pbm b/test/fixtures/evince/.pbm new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pcx b/test/fixtures/evince/.pcx new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pdf b/test/fixtures/evince/.pdf new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pdf.BZ2 b/test/fixtures/evince/.pdf.BZ2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pdf.GZ b/test/fixtures/evince/.pdf.GZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pdf.bz2 b/test/fixtures/evince/.pdf.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pdf.gz b/test/fixtures/evince/.pdf.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pgm b/test/fixtures/evince/.pgm new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.png b/test/fixtures/evince/.png new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.pnm b/test/fixtures/evince/.pnm new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.ppm b/test/fixtures/evince/.ppm new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.ps b/test/fixtures/evince/.ps new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.ps.BZ2 b/test/fixtures/evince/.ps.BZ2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.ps.GZ b/test/fixtures/evince/.ps.GZ new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.ps.bz2 b/test/fixtures/evince/.ps.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.ps.gz b/test/fixtures/evince/.ps.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.tga b/test/fixtures/evince/.tga new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.tif b/test/fixtures/evince/.tif new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.tiff b/test/fixtures/evince/.tiff new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.txt b/test/fixtures/evince/.txt new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.xpm b/test/fixtures/evince/.xpm new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/evince/.xwd b/test/fixtures/evince/.xwd new file mode 100644 index 00000000..e69de29b diff --git a/test/lib/completions/enscript.exp b/test/lib/completions/enscript.exp new file mode 100644 index 00000000..7fefabdd --- /dev/null +++ b/test/lib/completions/enscript.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "enscript --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/env.exp b/test/lib/completions/env.exp new file mode 100644 index 00000000..0f523cbc --- /dev/null +++ b/test/lib/completions/env.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "env --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/evince.exp b/test/lib/completions/evince.exp new file mode 100644 index 00000000..67dc8079 --- /dev/null +++ b/test/lib/completions/evince.exp @@ -0,0 +1,33 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +set files { + foo/ + .bmp .BMP .cbr .CBR .cbz .CBZ .djv .DJV .djvu .DJVU + .dvi .DVI .dvi.bz2 .dvi.BZ2 .DVI.bz2 .DVI.BZ2 .dvi.gz .dvi.GZ .DVI.gz .DVI.GZ + .eps .EPS .eps.bz2 .eps.BZ2 .EPS.bz2 .EPS.BZ2 .eps.gz .eps.GZ .EPS.gz .EPS.GZ + .gif .GIF .ico .ICO .jpeg .JPEG .jpg .JPG .miff .MIFF .pbm .PBM .pcx .PCX + .pdf .PDF .pdf.bz2 .pdf.BZ2 .PDF.bz2 .PDF.BZ2 .pdf.gz .pdf.GZ .PDF.gz .PDF.GZ + .pgm .PGM .png .PNG .pnm .PNM .ppm .PPM + .ps .PS .ps.bz2 .ps.BZ2 .PS.bz2 .PS.BZ2 .ps.gz .ps.GZ .PS.gz .PS.GZ + .tga .TGA .tif .TIF .tiff .TIFF + .xpm .XPM .xwd .XWD +} +set prompt "/fixtures/evince/@" +assert_bash_exec "cd fixtures/evince" "" $prompt +assert_complete $files "evince " "" $prompt +sync_after_int $prompt +assert_bash_exec "cd ../.." + + +teardown diff --git a/test/lib/completions/expand.exp b/test/lib/completions/expand.exp new file mode 100644 index 00000000..de1b7f6d --- /dev/null +++ b/test/lib/completions/expand.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "expand --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/finger.exp b/test/lib/completions/finger.exp index 935c9b27..136f1c6e 100644 --- a/test/lib/completions/finger.exp +++ b/test/lib/completions/finger.exp @@ -33,11 +33,11 @@ sync_after_int set test "Tab should complete hostnames" # Build string list of hostnames set hosts {} -foreach h [exec bash -c "compgen -A hostname"] { +foreach h [get_hosts] { # Prefix hosts with username 'test@' lappend hosts "test@$h" }; # foreach -assert_complete $hosts "finger test@" $test +assert_complete_partial $hosts finger test@ $test sync_after_int @@ -48,7 +48,7 @@ set test "Tab should complete partial hostname" # host. set hosts {} set char "" -foreach h [exec bash -c "compgen -A hostname"] { +foreach h [get_hosts] { if {$char == ""} {set char [string range $h 0 0]} # Only append hostname if starting with $char if {[string range $h 0 0] == "$char"} { diff --git a/test/lib/completions_to_review/enscript.exp b/test/lib/completions_to_review/enscript.exp deleted file mode 100644 index e261618c..00000000 --- a/test/lib/completions_to_review/enscript.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "enscript " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/env.exp b/test/lib/completions_to_review/env.exp deleted file mode 100644 index 35d6fefb..00000000 --- a/test/lib/completions_to_review/env.exp +++ /dev/null @@ -1,31 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "env " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -# Interrupt command - -set test "Sync after INT" -sleep 0.01 -send \031\003; # QUIT/INT -expect -ex /@ - - -teardown diff --git a/test/lib/completions_to_review/evince.exp b/test/lib/completions_to_review/evince.exp deleted file mode 100644 index 1d62aea4..00000000 --- a/test/lib/completions_to_review/evince.exp +++ /dev/null @@ -1,32 +0,0 @@ -proc setup {} { - set cmd "touch fixture1/t.{CB{R,Z},DJV{,U},cb{r,z},djv{,u}}"; # Create temporary files - send "$cmd\r" - expect -ex "$cmd\r\n/@" -}; # setup() - - -proc teardown {} { - set cmd "rm fixture1/t.{CB{R,Z},DJV{,U},cb{r,z},djv{,u}}"; # Remove temporary files - send "$cmd\r" - expect -ex "$cmd\r\n/@" -}; # teardown() - - -setup - - -set test "Tab should complete evince" - # Try completion -set cmd "evince fixture1/" -send "$cmd\t" -expect { - -re "^${cmd}\r\n(\.svn/ +|)bar bar.d/ +foo.d/ +(\.svn/ +|)t.cbr +t.CBR +t.cbz +t.CBZ +t.djv +t.DJV +t.djvu +t.DJVU *\r\n/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/expand.exp b/test/lib/completions_to_review/expand.exp deleted file mode 100644 index 7c2ecb0f..00000000 --- a/test/lib/completions_to_review/expand.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "expand " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/library.exp b/test/lib/library.exp index f6f56361..8f6c18bf 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -12,19 +12,20 @@ package require textutil::string # exit status of the previously executed bash command will be # checked; specify `title' to adorn the error message. # @param string $title (optional) Command title. If empty, `cmd' is used. -proc assert_bash_exec {{aCmd ""} {title ""}} { +# @param string $prompt (optional) Bash prompt. Default is "/@" +proc assert_bash_exec {{aCmd ""} {title ""} {prompt /@}} { if {[string length $aCmd] != 0} { send "$aCmd\r" expect -ex "$aCmd\r\n" }; # if if {[string length $title] == 0} {set title $aCmd} - expect -ex "/@" + expect -ex $prompt set out $expect_out(buffer); # Catch (non-expected) output set cmd "echo $?" send "$cmd\r" expect { - -ex "$cmd\r\n0\r\n/@" {} - /@ { + -ex "$cmd\r\n0\r\n$prompt" {} + $prompt { if {[info exists multipass_name]} { fail "ERROR executing bash command \"$title\"" }; # if @@ -51,12 +52,13 @@ proc assert_bash_type {command} { }; # assert_bash_type() -# Make sure the expected items are also returned by TAB-completing the -# specified command. +# Make sure the expected items are returned by TAB-completing the specified +# command. # Break items into chunks because `expect' seems to have a limited buffer size # @param list $expected # @param string $cmd Command given to generate items # @param string $test (optional) Test titel. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" # @param integer $size (optional) Chunk size. Default is 20. # @result boolean True if successful, False if not proc assert_complete {expected cmd {test ""} {prompt /@} {size 20}} { @@ -78,9 +80,14 @@ proc assert_complete {expected cmd {test ""} {prompt /@} {size 20}} { if {[llength $expected] == 1} { pass "$test" } else { + # Remove optional (partial) argument from `cmd'. + # E.g. "finger test@" becomes "finger" + set cmd2 [lindex [split $cmd] 0] + # Determine common prefix of completions set common [::textutil::string::longestCommonPrefixList $expected] + if {[string length $common] > 0} {set common " $common"} expect { - -ex "$prompt$cmd$common" { pass "$test" } + -ex "$prompt$cmd2$common" { pass "$test" } -re $prompt { unresolved "$test at prompt" } -re eof { unresolved "eof" } }; # expect @@ -98,6 +105,7 @@ proc assert_complete {expected cmd {test ""} {prompt /@} {size 20}} { # @param list $expected List of all completions. # @param string $cmd Command given to generate items # @param string $test (optional) Test titel. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" # @param integer $size (optional) Chunk size. Default is 20. # @result boolean True if successful, False if not proc assert_complete_partial {expected cmd {partial ""} {test ""} {prompt /@} {size 20}} { @@ -127,7 +135,7 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} { regsub -all {([\[\]\(\)\.\\\+])} $cmd {\\\1} cmd expect { -re "^\r\n.*$prompt$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } + -re $prompt { unresolved "$test at prompt" } -re eof { unresolved "eof" } }; # expect }; # assert_complete_any() @@ -136,7 +144,14 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} { # Make sure the bash environment hasn't changed between now and the last call # to `save_env()'. # @param string $sed Sed commands to preprocess diff output. -# E.g.: s/COMP_PATH=.*/COMP_PATH=PATH/ +# Example calls: +# +# # Replace `COMP_PATH=.*' with `COMP_PATH=PATH' +# assert_env_unmodified {s/COMP_PATH=.*/COMP_PATH=PATH/} +# +# # Remove lines containing with `OLDPWD=' +# assert_env_unmodified {/OLDPWD=/d} +# # @param string $file Filename to generate environment save file from. See # `gen_env_filename()'. # @param string $diff Expected diff output (after being processed by $sed) @@ -328,11 +343,12 @@ proc _save_env {{file ""}} { # Interrupt completion and sync with prompt. # Send signals QUIT & INT. -proc sync_after_int {} { +# @param string $prompt (optional) Bash prompt. Default is "/@" +proc sync_after_int {{prompt /@}} { set test "Sync after INT" sleep .1 send \031\003; # QUIT/INT - expect /@ + expect $prompt }; # sync_after_int() From 22675a60f794c2c76155b956eea2fb549de35da4 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 17 Jul 2009 23:15:15 +0200 Subject: [PATCH 13/69] Reviewed tests f* --- test/_completion_to_review/filesnarf.exp | 1 - test/_completion_to_review/find.exp | 1 - test/_completion_to_review/find_member.exp | 1 - test/_completion_to_review/fmt.exp | 1 - test/_completion_to_review/fold.exp | 1 - test/completion/filesnarf.exp | 3 ++ test/completion/find.exp | 3 ++ test/completion/find_member.exp | 3 ++ test/completion/fmt.exp | 3 ++ test/completion/fold.exp | 3 ++ test/lib/completions/evince.exp | 5 +- test/lib/completions/filesnarf.exp | 20 ++++++++ .../find.exp | 51 +++++-------------- test/lib/completions/find_member.exp | 20 ++++++++ test/lib/completions/fmt.exp | 20 ++++++++ test/lib/completions/fold.exp | 20 ++++++++ test/lib/completions_to_review/filesnarf.exp | 26 ---------- .../lib/completions_to_review/find_member.exp | 26 ---------- test/lib/completions_to_review/fmt.exp | 26 ---------- test/lib/completions_to_review/fold.exp | 26 ---------- test/lib/library.exp | 18 +++++-- 21 files changed, 127 insertions(+), 151 deletions(-) delete mode 100644 test/_completion_to_review/filesnarf.exp delete mode 100644 test/_completion_to_review/find.exp delete mode 100644 test/_completion_to_review/find_member.exp delete mode 100644 test/_completion_to_review/fmt.exp delete mode 100644 test/_completion_to_review/fold.exp create mode 100644 test/completion/filesnarf.exp create mode 100644 test/completion/find.exp create mode 100644 test/completion/find_member.exp create mode 100644 test/completion/fmt.exp create mode 100644 test/completion/fold.exp create mode 100644 test/lib/completions/filesnarf.exp rename test/lib/{completions_to_review => completions}/find.exp (57%) create mode 100644 test/lib/completions/find_member.exp create mode 100644 test/lib/completions/fmt.exp create mode 100644 test/lib/completions/fold.exp delete mode 100644 test/lib/completions_to_review/filesnarf.exp delete mode 100644 test/lib/completions_to_review/find_member.exp delete mode 100644 test/lib/completions_to_review/fmt.exp delete mode 100644 test/lib/completions_to_review/fold.exp diff --git a/test/_completion_to_review/filesnarf.exp b/test/_completion_to_review/filesnarf.exp deleted file mode 100644 index 74dd80a3..00000000 --- a/test/_completion_to_review/filesnarf.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/filesnarf.exp" diff --git a/test/_completion_to_review/find.exp b/test/_completion_to_review/find.exp deleted file mode 100644 index 0733f47e..00000000 --- a/test/_completion_to_review/find.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/find.exp" diff --git a/test/_completion_to_review/find_member.exp b/test/_completion_to_review/find_member.exp deleted file mode 100644 index dd0ee8b6..00000000 --- a/test/_completion_to_review/find_member.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/find_member.exp" diff --git a/test/_completion_to_review/fmt.exp b/test/_completion_to_review/fmt.exp deleted file mode 100644 index c81bb3c4..00000000 --- a/test/_completion_to_review/fmt.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/fmt.exp" diff --git a/test/_completion_to_review/fold.exp b/test/_completion_to_review/fold.exp deleted file mode 100644 index 82d0f9da..00000000 --- a/test/_completion_to_review/fold.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/fold.exp" diff --git a/test/completion/filesnarf.exp b/test/completion/filesnarf.exp new file mode 100644 index 00000000..d4ca7379 --- /dev/null +++ b/test/completion/filesnarf.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {filesnarf}]} { + source "lib/completions/filesnarf.exp" +}; # if diff --git a/test/completion/find.exp b/test/completion/find.exp new file mode 100644 index 00000000..b82e1328 --- /dev/null +++ b/test/completion/find.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {find}]} { + source "lib/completions/find.exp" +}; # if diff --git a/test/completion/find_member.exp b/test/completion/find_member.exp new file mode 100644 index 00000000..6bd32804 --- /dev/null +++ b/test/completion/find_member.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {find_member}]} { + source "lib/completions/find_member.exp" +}; # if diff --git a/test/completion/fmt.exp b/test/completion/fmt.exp new file mode 100644 index 00000000..abb52c11 --- /dev/null +++ b/test/completion/fmt.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {fmt}]} { + source "lib/completions/fmt.exp" +}; # if diff --git a/test/completion/fold.exp b/test/completion/fold.exp new file mode 100644 index 00000000..5e8d376f --- /dev/null +++ b/test/completion/fold.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {fold}]} { + source "lib/completions/fold.exp" +}; # if diff --git a/test/lib/completions/evince.exp b/test/lib/completions/evince.exp index 67dc8079..527a9958 100644 --- a/test/lib/completions/evince.exp +++ b/test/lib/completions/evince.exp @@ -11,6 +11,9 @@ proc teardown {} { setup +# NOTE: The directory `fixtures/evince' contains an additional subdir `foo' +# (should be visible as completion) and an additional file `.txt' +# (shouldn't be visible as completion) set files { foo/ .bmp .BMP .cbr .CBR .cbz .CBZ .djv .DJV .djvu .DJVU @@ -27,7 +30,7 @@ set prompt "/fixtures/evince/@" assert_bash_exec "cd fixtures/evince" "" $prompt assert_complete $files "evince " "" $prompt sync_after_int $prompt -assert_bash_exec "cd ../.." +assert_bash_exec "cd \$TESTDIR" teardown diff --git a/test/lib/completions/filesnarf.exp b/test/lib/completions/filesnarf.exp new file mode 100644 index 00000000..53cf01e4 --- /dev/null +++ b/test/lib/completions/filesnarf.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "filesnarf -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/find.exp b/test/lib/completions/find.exp similarity index 57% rename from test/lib/completions_to_review/find.exp rename to test/lib/completions/find.exp index e39d0384..63f5018d 100644 --- a/test/lib/completions_to_review/find.exp +++ b/test/lib/completions/find.exp @@ -1,23 +1,17 @@ proc setup {} { + save_env }; # setup() proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} }; # teardown() setup -set test "Tab should show completions" - # Try completion -set cmd "find " -send "$cmd\t" -expect { - -re "$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +assert_complete_any "find " sync_after_int @@ -35,39 +29,24 @@ sync_after_int set test "-wholename should complete files/dirs" - # Change directory -set cmd "cd fixture1" -send "$cmd\r" -expect -ex "$cmd\r\n/fixture1/@" - # Complete -set cmd "find -wholename " -send "$cmd\t" -expect { - -re "$cmd\r\n(\.svn/ +|)bar +bar bar.d/ +foo +foo.d/ *(\.svn/ *|)\r\n/fixture1/@$cmd$" { - pass "$test" - } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect + # Change directory to `fixture1' +set dir fixture1 +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt + # NOTE: `-p' adds a slash to directories +set files [split [exec bash -c "cd $dir && ls -p"] "\n"] +assert_complete $files "find -wholename " "" $prompt +sync_after_int $prompt +assert_bash_exec "cd \$TESTDIR" -sync_after_int - - - # Restore directory -set cmd "cd .." -send "$cmd\r" -expect -ex "$cmd\r\n/@" - set test "-uid should complete uids" # Complete set cmd "find -uid " send "$cmd\t" expect { - -re "$cmd\r\n\\d+.*/@$cmd$" { - pass "$test" - } + -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" } -re /@ { unresolved "$test at prompt" } -re eof { unresolved "eof" } }; # expect @@ -81,9 +60,7 @@ set test "-gid should complete gids" set cmd "find -gid " send "$cmd\t" expect { - -re "$cmd\r\n\\d+.*/@$cmd$" { - pass "$test" - } + -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" } -re /@ { unresolved "$test at prompt" } -re eof { unresolved "eof" } }; # expect diff --git a/test/lib/completions/find_member.exp b/test/lib/completions/find_member.exp new file mode 100644 index 00000000..58fac7d2 --- /dev/null +++ b/test/lib/completions/find_member.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "find_member -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/fmt.exp b/test/lib/completions/fmt.exp new file mode 100644 index 00000000..fcf8a922 --- /dev/null +++ b/test/lib/completions/fmt.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "fmt -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/fold.exp b/test/lib/completions/fold.exp new file mode 100644 index 00000000..673fe214 --- /dev/null +++ b/test/lib/completions/fold.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "fold --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/filesnarf.exp b/test/lib/completions_to_review/filesnarf.exp deleted file mode 100644 index 1f2aaa15..00000000 --- a/test/lib/completions_to_review/filesnarf.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "filesnarf -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/find_member.exp b/test/lib/completions_to_review/find_member.exp deleted file mode 100644 index e6dccb69..00000000 --- a/test/lib/completions_to_review/find_member.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "find_member -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/fmt.exp b/test/lib/completions_to_review/fmt.exp deleted file mode 100644 index 9ba81c65..00000000 --- a/test/lib/completions_to_review/fmt.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "fmt " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/fold.exp b/test/lib/completions_to_review/fold.exp deleted file mode 100644 index 8e3d0db4..00000000 --- a/test/lib/completions_to_review/fold.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "fold " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/library.exp b/test/lib/library.exp index 8f6c18bf..f5043ffa 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -134,7 +134,11 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} { # Escape special regexp characters regsub -all {([\[\]\(\)\.\\\+])} $cmd {\\\1} cmd expect { - -re "^\r\n.*$prompt$cmd$" { pass "$test" } + # NOTE: The `\S*' (zero or more non-whitespace characters) matches a + # possible enlargement of a command's partial completion if the + # list of completions have a larger common prefix. + # E.g. `fmt -' becomes `fmt --' (two dashes) when completing + -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" } -re $prompt { unresolved "$test at prompt" } -re eof { unresolved "eof" } }; # expect @@ -238,10 +242,16 @@ proc assert_exec {cmd {stdout ''} {test ''}} { # @return list Hostnames proc get_hosts {} { set hosts [exec bash -c "compgen -A hostname"] - lappend hosts [exec bash -c { - type avahi-browse >&/dev/null && - avahi-browse -kcpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u + # NOTE: Circumenventing `avahi_host' and appending directly to `hosts' + # causes an empty element to be inserted in `hosts'. + # -- FVu, Fri Jul 17 23:11:46 CEST 2009 + set avahi_hosts [exec bash -c { + type avahi-browse >&/dev/null && [ -n "$(pidof avahi-daemon)" ] + avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u }] + if {[llength $avahi_hosts] > 1} { + lappend hosts $avahi_hosts + }; # if return $hosts }; # get_hosts() From c6af1bf43510b0046added962bb62e30855cc191 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sat, 18 Jul 2009 09:43:25 +0200 Subject: [PATCH 14/69] Reviewed tests g* Removed excess parenthesis from gdb completion --- contrib/gdb | 2 +- test/_completion_to_review/g++.exp | 1 - test/_completion_to_review/g4.exp | 1 - test/_completion_to_review/g77.exp | 1 - test/_completion_to_review/gcc.exp | 1 - test/_completion_to_review/gcj.exp | 1 - test/_completion_to_review/gcl.exp | 1 - test/_completion_to_review/gdb.exp | 1 - test/_completion_to_review/genaliases.exp | 1 - test/_completion_to_review/getent.exp | 1 - test/_completion_to_review/gkrellm.exp | 1 - test/_completion_to_review/gmplayer.exp | 1 - test/_completion_to_review/gnatmake.exp | 1 - test/_completion_to_review/gpc.exp | 1 - test/_completion_to_review/gperf.exp | 1 - test/_completion_to_review/gpg.exp | 1 - test/_completion_to_review/gprof.exp | 1 - test/_completion_to_review/grep.exp | 1 - test/_completion_to_review/grub.exp | 1 - test/completion/c++.exp | 4 ++- test/completion/g++.exp | 3 ++ test/completion/g4.exp | 3 ++ test/completion/g77.exp | 3 ++ test/completion/gcc.exp | 3 ++ test/completion/gcj.exp | 3 ++ test/completion/gcl.exp | 3 ++ test/completion/gdb.exp | 3 ++ test/completion/genaliases.exp | 3 ++ test/completion/getent.exp | 3 ++ test/completion/gkrellm.exp | 3 ++ test/completion/gmplayer.exp | 3 ++ test/completion/gnatmake.exp | 3 ++ test/completion/gpc.exp | 3 ++ test/completion/gperf.exp | 3 ++ test/completion/gpg.exp | 3 ++ test/completion/gprof.exp | 3 ++ test/completion/grep.exp | 3 ++ test/completion/grub.exp | 3 ++ test/lib/completions/g++.exp | 20 ++++++++++++ test/lib/completions/g4.exp | 20 ++++++++++++ test/lib/completions/g77.exp | 20 ++++++++++++ test/lib/completions/gcc.exp | 20 ++++++++++++ test/lib/completions/gcj.exp | 20 ++++++++++++ test/lib/completions/gcl.exp | 20 ++++++++++++ test/lib/completions/gdb.exp | 20 ++++++++++++ test/lib/completions/genaliases.exp | 20 ++++++++++++ test/lib/completions/getent.exp | 20 ++++++++++++ test/lib/completions/gkrellm.exp | 20 ++++++++++++ test/lib/completions/gmplayer.exp | 20 ++++++++++++ test/lib/completions/gnatmake.exp | 20 ++++++++++++ test/lib/completions/gpc.exp | 20 ++++++++++++ test/lib/completions/gperf.exp | 20 ++++++++++++ test/lib/completions/gpg.exp | 20 ++++++++++++ test/lib/completions/gprof.exp | 20 ++++++++++++ test/lib/completions/grep.exp | 20 ++++++++++++ test/lib/completions/grub.exp | 20 ++++++++++++ .../gzip.exp | 0 test/lib/completions_to_review/g++.exp | 25 --------------- test/lib/completions_to_review/g4.exp | 26 ---------------- test/lib/completions_to_review/g77.exp | 26 ---------------- test/lib/completions_to_review/gcc.exp | 26 ---------------- test/lib/completions_to_review/gcj.exp | 31 ------------------- test/lib/completions_to_review/gcl.exp | 31 ------------------- test/lib/completions_to_review/gdb.exp | 26 ---------------- test/lib/completions_to_review/genaliases.exp | 26 ---------------- test/lib/completions_to_review/getent.exp | 26 ---------------- test/lib/completions_to_review/gkrellm.exp | 26 ---------------- test/lib/completions_to_review/gmplayer.exp | 26 ---------------- test/lib/completions_to_review/gnatmake.exp | 26 ---------------- test/lib/completions_to_review/gpc.exp | 26 ---------------- test/lib/completions_to_review/gperf.exp | 26 ---------------- test/lib/completions_to_review/gpg.exp | 31 ------------------- test/lib/completions_to_review/gprof.exp | 26 ---------------- test/lib/completions_to_review/grep.exp | 26 ---------------- test/lib/completions_to_review/grub.exp | 26 ---------------- 75 files changed, 418 insertions(+), 502 deletions(-) delete mode 100644 test/_completion_to_review/g++.exp delete mode 100644 test/_completion_to_review/g4.exp delete mode 100644 test/_completion_to_review/g77.exp delete mode 100644 test/_completion_to_review/gcc.exp delete mode 100644 test/_completion_to_review/gcj.exp delete mode 100644 test/_completion_to_review/gcl.exp delete mode 100644 test/_completion_to_review/gdb.exp delete mode 100644 test/_completion_to_review/genaliases.exp delete mode 100644 test/_completion_to_review/getent.exp delete mode 100644 test/_completion_to_review/gkrellm.exp delete mode 100644 test/_completion_to_review/gmplayer.exp delete mode 100644 test/_completion_to_review/gnatmake.exp delete mode 100644 test/_completion_to_review/gpc.exp delete mode 100644 test/_completion_to_review/gperf.exp delete mode 100644 test/_completion_to_review/gpg.exp delete mode 100644 test/_completion_to_review/gprof.exp delete mode 100644 test/_completion_to_review/grep.exp delete mode 100644 test/_completion_to_review/grub.exp create mode 100644 test/completion/g++.exp create mode 100644 test/completion/g4.exp create mode 100644 test/completion/g77.exp create mode 100644 test/completion/gcc.exp create mode 100644 test/completion/gcj.exp create mode 100644 test/completion/gcl.exp create mode 100644 test/completion/gdb.exp create mode 100644 test/completion/genaliases.exp create mode 100644 test/completion/getent.exp create mode 100644 test/completion/gkrellm.exp create mode 100644 test/completion/gmplayer.exp create mode 100644 test/completion/gnatmake.exp create mode 100644 test/completion/gpc.exp create mode 100644 test/completion/gperf.exp create mode 100644 test/completion/gpg.exp create mode 100644 test/completion/gprof.exp create mode 100644 test/completion/grep.exp create mode 100644 test/completion/grub.exp create mode 100644 test/lib/completions/g++.exp create mode 100644 test/lib/completions/g4.exp create mode 100644 test/lib/completions/g77.exp create mode 100644 test/lib/completions/gcc.exp create mode 100644 test/lib/completions/gcj.exp create mode 100644 test/lib/completions/gcl.exp create mode 100644 test/lib/completions/gdb.exp create mode 100644 test/lib/completions/genaliases.exp create mode 100644 test/lib/completions/getent.exp create mode 100644 test/lib/completions/gkrellm.exp create mode 100644 test/lib/completions/gmplayer.exp create mode 100644 test/lib/completions/gnatmake.exp create mode 100644 test/lib/completions/gpc.exp create mode 100644 test/lib/completions/gperf.exp create mode 100644 test/lib/completions/gpg.exp create mode 100644 test/lib/completions/gprof.exp create mode 100644 test/lib/completions/grep.exp create mode 100644 test/lib/completions/grub.exp rename test/lib/{completions_to_review => completions}/gzip.exp (100%) delete mode 100644 test/lib/completions_to_review/g++.exp delete mode 100644 test/lib/completions_to_review/g4.exp delete mode 100644 test/lib/completions_to_review/g77.exp delete mode 100644 test/lib/completions_to_review/gcc.exp delete mode 100644 test/lib/completions_to_review/gcj.exp delete mode 100644 test/lib/completions_to_review/gcl.exp delete mode 100644 test/lib/completions_to_review/gdb.exp delete mode 100644 test/lib/completions_to_review/genaliases.exp delete mode 100644 test/lib/completions_to_review/getent.exp delete mode 100644 test/lib/completions_to_review/gkrellm.exp delete mode 100644 test/lib/completions_to_review/gmplayer.exp delete mode 100644 test/lib/completions_to_review/gnatmake.exp delete mode 100644 test/lib/completions_to_review/gpc.exp delete mode 100644 test/lib/completions_to_review/gperf.exp delete mode 100644 test/lib/completions_to_review/gpg.exp delete mode 100644 test/lib/completions_to_review/gprof.exp delete mode 100644 test/lib/completions_to_review/grep.exp delete mode 100644 test/lib/completions_to_review/grub.exp diff --git a/contrib/gdb b/contrib/gdb index 7849f4f7..d89f3c92 100644 --- a/contrib/gdb +++ b/contrib/gdb @@ -32,7 +32,7 @@ _gdb() elif [ $COMP_CWORD -eq 2 ]; then prev=${prev##*/} COMPREPLY=( $( compgen -fW "$( command ps axo comm,pid | \ - awk '{if ($1 ~ /^'"$prev"'/) print $2}' ) )" \ + awk '{if ($1 ~ /^'"$prev"'/) print $2}' )" \ -- "$cur" ) ) fi } && diff --git a/test/_completion_to_review/g++.exp b/test/_completion_to_review/g++.exp deleted file mode 100644 index abf5833b..00000000 --- a/test/_completion_to_review/g++.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/g++.exp" diff --git a/test/_completion_to_review/g4.exp b/test/_completion_to_review/g4.exp deleted file mode 100644 index 6ef80a2c..00000000 --- a/test/_completion_to_review/g4.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/g4.exp" diff --git a/test/_completion_to_review/g77.exp b/test/_completion_to_review/g77.exp deleted file mode 100644 index 681fd236..00000000 --- a/test/_completion_to_review/g77.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/g77.exp" diff --git a/test/_completion_to_review/gcc.exp b/test/_completion_to_review/gcc.exp deleted file mode 100644 index 3df34f27..00000000 --- a/test/_completion_to_review/gcc.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gcc.exp" diff --git a/test/_completion_to_review/gcj.exp b/test/_completion_to_review/gcj.exp deleted file mode 100644 index 773c4faa..00000000 --- a/test/_completion_to_review/gcj.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gcj.exp" diff --git a/test/_completion_to_review/gcl.exp b/test/_completion_to_review/gcl.exp deleted file mode 100644 index 58f0182a..00000000 --- a/test/_completion_to_review/gcl.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gcl.exp" diff --git a/test/_completion_to_review/gdb.exp b/test/_completion_to_review/gdb.exp deleted file mode 100644 index e721f51f..00000000 --- a/test/_completion_to_review/gdb.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gdb.exp" diff --git a/test/_completion_to_review/genaliases.exp b/test/_completion_to_review/genaliases.exp deleted file mode 100644 index 2436701f..00000000 --- a/test/_completion_to_review/genaliases.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/genaliases.exp" diff --git a/test/_completion_to_review/getent.exp b/test/_completion_to_review/getent.exp deleted file mode 100644 index fde2b0e1..00000000 --- a/test/_completion_to_review/getent.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/getent.exp" diff --git a/test/_completion_to_review/gkrellm.exp b/test/_completion_to_review/gkrellm.exp deleted file mode 100644 index 4005b0e2..00000000 --- a/test/_completion_to_review/gkrellm.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gkrellm.exp" diff --git a/test/_completion_to_review/gmplayer.exp b/test/_completion_to_review/gmplayer.exp deleted file mode 100644 index 4b97aa47..00000000 --- a/test/_completion_to_review/gmplayer.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gmplayer.exp" diff --git a/test/_completion_to_review/gnatmake.exp b/test/_completion_to_review/gnatmake.exp deleted file mode 100644 index b70183b6..00000000 --- a/test/_completion_to_review/gnatmake.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gnatmake.exp" diff --git a/test/_completion_to_review/gpc.exp b/test/_completion_to_review/gpc.exp deleted file mode 100644 index b5c8ca4a..00000000 --- a/test/_completion_to_review/gpc.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gpc.exp" diff --git a/test/_completion_to_review/gperf.exp b/test/_completion_to_review/gperf.exp deleted file mode 100644 index ec562d82..00000000 --- a/test/_completion_to_review/gperf.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gperf.exp" diff --git a/test/_completion_to_review/gpg.exp b/test/_completion_to_review/gpg.exp deleted file mode 100644 index b09f3922..00000000 --- a/test/_completion_to_review/gpg.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gpg.exp" diff --git a/test/_completion_to_review/gprof.exp b/test/_completion_to_review/gprof.exp deleted file mode 100644 index d8936083..00000000 --- a/test/_completion_to_review/gprof.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/gprof.exp" diff --git a/test/_completion_to_review/grep.exp b/test/_completion_to_review/grep.exp deleted file mode 100644 index 838c9f7e..00000000 --- a/test/_completion_to_review/grep.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/grep.exp" diff --git a/test/_completion_to_review/grub.exp b/test/_completion_to_review/grub.exp deleted file mode 100644 index be435809..00000000 --- a/test/_completion_to_review/grub.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/grub.exp" diff --git a/test/completion/c++.exp b/test/completion/c++.exp index 0b3ff2cb..abaa7be5 100644 --- a/test/completion/c++.exp +++ b/test/completion/c++.exp @@ -1 +1,3 @@ -source "lib/completions/c++.exp" +if {[assert_bash_type {gcc}]} { + source "lib/completions/c++.exp" +}; # if diff --git a/test/completion/g++.exp b/test/completion/g++.exp new file mode 100644 index 00000000..3210ed29 --- /dev/null +++ b/test/completion/g++.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gcc}]} { + source "lib/completions/g++.exp" +}; # if diff --git a/test/completion/g4.exp b/test/completion/g4.exp new file mode 100644 index 00000000..1074d02b --- /dev/null +++ b/test/completion/g4.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {g4}]} { + source "lib/completions/g4.exp" +}; # if diff --git a/test/completion/g77.exp b/test/completion/g77.exp new file mode 100644 index 00000000..0c592ae0 --- /dev/null +++ b/test/completion/g77.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gcc}]} { + source "lib/completions/g77.exp" +}; # if diff --git a/test/completion/gcc.exp b/test/completion/gcc.exp new file mode 100644 index 00000000..2b1d9ba8 --- /dev/null +++ b/test/completion/gcc.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gcc}]} { + source "lib/completions/gcc.exp" +}; # if diff --git a/test/completion/gcj.exp b/test/completion/gcj.exp new file mode 100644 index 00000000..ca32ab6f --- /dev/null +++ b/test/completion/gcj.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gcc}]} { + source "lib/completions/gcj.exp" +}; # if diff --git a/test/completion/gcl.exp b/test/completion/gcl.exp new file mode 100644 index 00000000..d83086f4 --- /dev/null +++ b/test/completion/gcl.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gcl}]} { + source "lib/completions/gcl.exp" +}; # if diff --git a/test/completion/gdb.exp b/test/completion/gdb.exp new file mode 100644 index 00000000..0612dea3 --- /dev/null +++ b/test/completion/gdb.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gdb}]} { + source "lib/completions/gdb.exp" +}; # if diff --git a/test/completion/genaliases.exp b/test/completion/genaliases.exp new file mode 100644 index 00000000..74ec3d47 --- /dev/null +++ b/test/completion/genaliases.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {genaliases}]} { + source "lib/completions/genaliases.exp" +}; # if diff --git a/test/completion/getent.exp b/test/completion/getent.exp new file mode 100644 index 00000000..6cdb7989 --- /dev/null +++ b/test/completion/getent.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {getent}]} { + source "lib/completions/getent.exp" +}; # if diff --git a/test/completion/gkrellm.exp b/test/completion/gkrellm.exp new file mode 100644 index 00000000..e244392b --- /dev/null +++ b/test/completion/gkrellm.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gkrellm}]} { + source "lib/completions/gkrellm.exp" +}; # if diff --git a/test/completion/gmplayer.exp b/test/completion/gmplayer.exp new file mode 100644 index 00000000..a37fad48 --- /dev/null +++ b/test/completion/gmplayer.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {mplayer}]} { + source "lib/completions/gmplayer.exp" +}; # if diff --git a/test/completion/gnatmake.exp b/test/completion/gnatmake.exp new file mode 100644 index 00000000..ab0dbc3e --- /dev/null +++ b/test/completion/gnatmake.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gnatmake}]} { + source "lib/completions/gnatmake.exp" +}; # if diff --git a/test/completion/gpc.exp b/test/completion/gpc.exp new file mode 100644 index 00000000..e362c01f --- /dev/null +++ b/test/completion/gpc.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gcc}]} { + source "lib/completions/gpc.exp" +}; # if diff --git a/test/completion/gperf.exp b/test/completion/gperf.exp new file mode 100644 index 00000000..527425af --- /dev/null +++ b/test/completion/gperf.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gperf}]} { + source "lib/completions/gperf.exp" +}; # if diff --git a/test/completion/gpg.exp b/test/completion/gpg.exp new file mode 100644 index 00000000..64284d33 --- /dev/null +++ b/test/completion/gpg.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gpg}]} { + source "lib/completions/gpg.exp" +}; # if diff --git a/test/completion/gprof.exp b/test/completion/gprof.exp new file mode 100644 index 00000000..cf7c62cc --- /dev/null +++ b/test/completion/gprof.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {gprof}]} { + source "lib/completions/gprof.exp" +}; # if diff --git a/test/completion/grep.exp b/test/completion/grep.exp new file mode 100644 index 00000000..4f053664 --- /dev/null +++ b/test/completion/grep.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {grep}]} { + source "lib/completions/grep.exp" +}; # if diff --git a/test/completion/grub.exp b/test/completion/grub.exp new file mode 100644 index 00000000..7cf25958 --- /dev/null +++ b/test/completion/grub.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {grub}]} { + source "lib/completions/grub.exp" +}; # if diff --git a/test/lib/completions/g++.exp b/test/lib/completions/g++.exp new file mode 100644 index 00000000..4dc2591a --- /dev/null +++ b/test/lib/completions/g++.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "g++ " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/g4.exp b/test/lib/completions/g4.exp new file mode 100644 index 00000000..203de061 --- /dev/null +++ b/test/lib/completions/g4.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "g4 " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/g77.exp b/test/lib/completions/g77.exp new file mode 100644 index 00000000..8802aca9 --- /dev/null +++ b/test/lib/completions/g77.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "g77 " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gcc.exp b/test/lib/completions/gcc.exp new file mode 100644 index 00000000..8e52a120 --- /dev/null +++ b/test/lib/completions/gcc.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gcc " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gcj.exp b/test/lib/completions/gcj.exp new file mode 100644 index 00000000..db52d59a --- /dev/null +++ b/test/lib/completions/gcj.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gcj " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gcl.exp b/test/lib/completions/gcl.exp new file mode 100644 index 00000000..7cead846 --- /dev/null +++ b/test/lib/completions/gcl.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gcl " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gdb.exp b/test/lib/completions/gdb.exp new file mode 100644 index 00000000..982f0878 --- /dev/null +++ b/test/lib/completions/gdb.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gdb - " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/genaliases.exp b/test/lib/completions/genaliases.exp new file mode 100644 index 00000000..064eb386 --- /dev/null +++ b/test/lib/completions/genaliases.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "genaliases -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/getent.exp b/test/lib/completions/getent.exp new file mode 100644 index 00000000..121f3b38 --- /dev/null +++ b/test/lib/completions/getent.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "getent " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gkrellm.exp b/test/lib/completions/gkrellm.exp new file mode 100644 index 00000000..f8b0dd4d --- /dev/null +++ b/test/lib/completions/gkrellm.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gkrellm -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gmplayer.exp b/test/lib/completions/gmplayer.exp new file mode 100644 index 00000000..d9032698 --- /dev/null +++ b/test/lib/completions/gmplayer.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gmplayer " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gnatmake.exp b/test/lib/completions/gnatmake.exp new file mode 100644 index 00000000..902aa062 --- /dev/null +++ b/test/lib/completions/gnatmake.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gnatmake " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gpc.exp b/test/lib/completions/gpc.exp new file mode 100644 index 00000000..6c4d0383 --- /dev/null +++ b/test/lib/completions/gpc.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gpc " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gperf.exp b/test/lib/completions/gperf.exp new file mode 100644 index 00000000..aa24333e --- /dev/null +++ b/test/lib/completions/gperf.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gperf --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gpg.exp b/test/lib/completions/gpg.exp new file mode 100644 index 00000000..29fd2244 --- /dev/null +++ b/test/lib/completions/gpg.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gpg " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/gprof.exp b/test/lib/completions/gprof.exp new file mode 100644 index 00000000..b436b9d1 --- /dev/null +++ b/test/lib/completions/gprof.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gprof --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/grep.exp b/test/lib/completions/grep.exp new file mode 100644 index 00000000..3814df71 --- /dev/null +++ b/test/lib/completions/grep.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "grep --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/grub.exp b/test/lib/completions/grub.exp new file mode 100644 index 00000000..9578e789 --- /dev/null +++ b/test/lib/completions/grub.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "grub --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/gzip.exp b/test/lib/completions/gzip.exp similarity index 100% rename from test/lib/completions_to_review/gzip.exp rename to test/lib/completions/gzip.exp diff --git a/test/lib/completions_to_review/g++.exp b/test/lib/completions_to_review/g++.exp deleted file mode 100644 index 0613eae6..00000000 --- a/test/lib/completions_to_review/g++.exp +++ /dev/null @@ -1,25 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -send "g++ \t" -expect { - -re "^g\\+\\+ \r\n.*g\\+\\+ $" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/g4.exp b/test/lib/completions_to_review/g4.exp deleted file mode 100644 index 664cad74..00000000 --- a/test/lib/completions_to_review/g4.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "g4 " -send "$cmd\t" -expect { - -re "^${cmd}(bash: p4: command not found\r\n)*\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/g77.exp b/test/lib/completions_to_review/g77.exp deleted file mode 100644 index 6218cb76..00000000 --- a/test/lib/completions_to_review/g77.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "g77 " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/gcc.exp b/test/lib/completions_to_review/gcc.exp deleted file mode 100644 index bc0fbe39..00000000 --- a/test/lib/completions_to_review/gcc.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gcc " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/gcj.exp b/test/lib/completions_to_review/gcj.exp deleted file mode 100644 index 8f1ef18e..00000000 --- a/test/lib/completions_to_review/gcj.exp +++ /dev/null @@ -1,31 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gcj " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -# Interrupt command - -set test "Sync after INT" -sleep 0.01 -send \031\003; # QUIT/INT -expect -ex /@ - - -teardown diff --git a/test/lib/completions_to_review/gcl.exp b/test/lib/completions_to_review/gcl.exp deleted file mode 100644 index c9a964d1..00000000 --- a/test/lib/completions_to_review/gcl.exp +++ /dev/null @@ -1,31 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gcl " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -# Interrupt command - -set test "Sync after INT" -sleep 0.01 -send \031\003; # QUIT/INT -expect -ex /@ - - -teardown diff --git a/test/lib/completions_to_review/gdb.exp b/test/lib/completions_to_review/gdb.exp deleted file mode 100644 index 9059e899..00000000 --- a/test/lib/completions_to_review/gdb.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gdb - " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/genaliases.exp b/test/lib/completions_to_review/genaliases.exp deleted file mode 100644 index 32c881fd..00000000 --- a/test/lib/completions_to_review/genaliases.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "genaliases -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/getent.exp b/test/lib/completions_to_review/getent.exp deleted file mode 100644 index d48ff77f..00000000 --- a/test/lib/completions_to_review/getent.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "getent " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/gkrellm.exp b/test/lib/completions_to_review/gkrellm.exp deleted file mode 100644 index 9abef56b..00000000 --- a/test/lib/completions_to_review/gkrellm.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gkrellm -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/gmplayer.exp b/test/lib/completions_to_review/gmplayer.exp deleted file mode 100644 index bcd1f45c..00000000 --- a/test/lib/completions_to_review/gmplayer.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gmplayer " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/gnatmake.exp b/test/lib/completions_to_review/gnatmake.exp deleted file mode 100644 index 13867580..00000000 --- a/test/lib/completions_to_review/gnatmake.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gnatmake " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/gpc.exp b/test/lib/completions_to_review/gpc.exp deleted file mode 100644 index 8d473ed2..00000000 --- a/test/lib/completions_to_review/gpc.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gpc " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/gperf.exp b/test/lib/completions_to_review/gperf.exp deleted file mode 100644 index a6a54701..00000000 --- a/test/lib/completions_to_review/gperf.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gperf " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/gpg.exp b/test/lib/completions_to_review/gpg.exp deleted file mode 100644 index 72ed4d28..00000000 --- a/test/lib/completions_to_review/gpg.exp +++ /dev/null @@ -1,31 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gpg " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -# Interrupt command - -set test "Sync after INT" -sleep 0.01 -send \031\003; # QUIT/INT -expect -ex /@ - - -teardown diff --git a/test/lib/completions_to_review/gprof.exp b/test/lib/completions_to_review/gprof.exp deleted file mode 100644 index 05668d05..00000000 --- a/test/lib/completions_to_review/gprof.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "gprof " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/grep.exp b/test/lib/completions_to_review/grep.exp deleted file mode 100644 index 9083cd62..00000000 --- a/test/lib/completions_to_review/grep.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "grep " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/grub.exp b/test/lib/completions_to_review/grub.exp deleted file mode 100644 index 9dcfa414..00000000 --- a/test/lib/completions_to_review/grub.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "grub " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From 11302d40388b700132dd722d2cbbc531477c74c5 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sat, 18 Jul 2009 16:55:23 +0200 Subject: [PATCH 15/69] Reviewed tests h* & i* Localized `i' variable in `info' completion. --- contrib/info | 2 +- test/_completion_to_review/head.exp | 1 - test/_completion_to_review/hg.exp | 1 - test/_completion_to_review/iconv.exp | 1 - test/_completion_to_review/id.exp | 1 - test/_completion_to_review/identify.exp | 1 - test/_completion_to_review/ifdown.exp | 1 - test/_completion_to_review/ifup.exp | 1 - test/_completion_to_review/indent.exp | 1 - test/_completion_to_review/info.exp | 1 - test/_completion_to_review/inject.exp | 1 - test/_completion_to_review/insmod.exp | 1 - test/_completion_to_review/invoke-rc.d.exp | 1 - test/_completion_to_review/irb.exp | 1 - test/_completion_to_review/isql.exp | 1 - test/completion/head.exp | 3 ++ test/completion/iconv.exp | 3 ++ test/completion/id.exp | 3 ++ test/completion/identify.exp | 3 ++ test/completion/ifdown.exp | 3 ++ test/completion/ifup.exp | 3 ++ test/completion/indent.exp | 3 ++ test/completion/info.exp | 3 ++ test/completion/inject.exp | 3 ++ test/completion/insmod.exp | 3 ++ test/completion/invoke-rc.d.exp | 3 ++ test/completion/irb.exp | 3 ++ test/completion/isql.exp | 3 ++ .../iwconfig.exp | 0 .../iwlist.exp | 0 .../iwpriv.exp | 0 .../iwspy.exp | 0 test/fixtures/isql/odbc.ini | 3 ++ test/lib/completions/head.exp | 20 +++++++++ test/lib/completions/iconv.exp | 20 +++++++++ test/lib/completions/id.exp | 20 +++++++++ test/lib/completions/identify.exp | 20 +++++++++ test/lib/completions/ifdown.exp | 20 +++++++++ test/lib/completions/ifup.exp | 20 +++++++++ test/lib/completions/indent.exp | 20 +++++++++ test/lib/completions/info.exp | 20 +++++++++ test/lib/completions/inject.exp | 20 +++++++++ test/lib/completions/insmod.exp | 20 +++++++++ test/lib/completions/invoke-rc.d.exp | 20 +++++++++ test/lib/completions/irb.exp | 20 +++++++++ test/lib/completions/isql.exp | 23 ++++++++++ test/lib/completions/iwconfig.exp | 20 +++++++++ test/lib/completions/iwlist.exp | 20 +++++++++ test/lib/completions/iwpriv.exp | 20 +++++++++ test/lib/completions/iwspy.exp | 20 +++++++++ test/lib/completions_to_review/head.exp | 26 ----------- test/lib/completions_to_review/hg.exp | 26 ----------- test/lib/completions_to_review/iconv.exp | 26 ----------- test/lib/completions_to_review/id.exp | 26 ----------- test/lib/completions_to_review/identify.exp | 26 ----------- test/lib/completions_to_review/ifdown.exp | 27 ------------ test/lib/completions_to_review/ifup.exp | 44 ------------------- test/lib/completions_to_review/indent.exp | 26 ----------- test/lib/completions_to_review/info.exp | 31 ------------- test/lib/completions_to_review/inject.exp | 26 ----------- test/lib/completions_to_review/insmod.exp | 26 ----------- .../lib/completions_to_review/invoke-rc.d.exp | 26 ----------- test/lib/completions_to_review/irb.exp | 26 ----------- test/lib/completions_to_review/isql.exp | 34 -------------- test/lib/completions_to_review/iwconfig.exp | 40 ----------------- test/lib/completions_to_review/iwlist.exp | 31 ------------- test/lib/completions_to_review/iwpriv.exp | 26 ----------- test/lib/completions_to_review/iwspy.exp | 31 ------------- test/lib/library.exp | 16 +++++-- 69 files changed, 399 insertions(+), 542 deletions(-) delete mode 100644 test/_completion_to_review/head.exp delete mode 100644 test/_completion_to_review/hg.exp delete mode 100644 test/_completion_to_review/iconv.exp delete mode 100644 test/_completion_to_review/id.exp delete mode 100644 test/_completion_to_review/identify.exp delete mode 100644 test/_completion_to_review/ifdown.exp delete mode 100644 test/_completion_to_review/ifup.exp delete mode 100644 test/_completion_to_review/indent.exp delete mode 100644 test/_completion_to_review/info.exp delete mode 100644 test/_completion_to_review/inject.exp delete mode 100644 test/_completion_to_review/insmod.exp delete mode 100644 test/_completion_to_review/invoke-rc.d.exp delete mode 100644 test/_completion_to_review/irb.exp delete mode 100644 test/_completion_to_review/isql.exp create mode 100644 test/completion/head.exp create mode 100644 test/completion/iconv.exp create mode 100644 test/completion/id.exp create mode 100644 test/completion/identify.exp create mode 100644 test/completion/ifdown.exp create mode 100644 test/completion/ifup.exp create mode 100644 test/completion/indent.exp create mode 100644 test/completion/info.exp create mode 100644 test/completion/inject.exp create mode 100644 test/completion/insmod.exp create mode 100644 test/completion/invoke-rc.d.exp create mode 100644 test/completion/irb.exp create mode 100644 test/completion/isql.exp rename test/{_completion_to_review => completion}/iwconfig.exp (100%) rename test/{_completion_to_review => completion}/iwlist.exp (100%) rename test/{_completion_to_review => completion}/iwpriv.exp (100%) rename test/{_completion_to_review => completion}/iwspy.exp (100%) create mode 100644 test/fixtures/isql/odbc.ini create mode 100644 test/lib/completions/head.exp create mode 100644 test/lib/completions/iconv.exp create mode 100644 test/lib/completions/id.exp create mode 100644 test/lib/completions/identify.exp create mode 100644 test/lib/completions/ifdown.exp create mode 100644 test/lib/completions/ifup.exp create mode 100644 test/lib/completions/indent.exp create mode 100644 test/lib/completions/info.exp create mode 100644 test/lib/completions/inject.exp create mode 100644 test/lib/completions/insmod.exp create mode 100644 test/lib/completions/invoke-rc.d.exp create mode 100644 test/lib/completions/irb.exp create mode 100644 test/lib/completions/isql.exp create mode 100644 test/lib/completions/iwconfig.exp create mode 100644 test/lib/completions/iwlist.exp create mode 100644 test/lib/completions/iwpriv.exp create mode 100644 test/lib/completions/iwspy.exp delete mode 100644 test/lib/completions_to_review/head.exp delete mode 100644 test/lib/completions_to_review/hg.exp delete mode 100644 test/lib/completions_to_review/iconv.exp delete mode 100644 test/lib/completions_to_review/id.exp delete mode 100644 test/lib/completions_to_review/identify.exp delete mode 100644 test/lib/completions_to_review/ifdown.exp delete mode 100644 test/lib/completions_to_review/ifup.exp delete mode 100644 test/lib/completions_to_review/indent.exp delete mode 100644 test/lib/completions_to_review/info.exp delete mode 100644 test/lib/completions_to_review/inject.exp delete mode 100644 test/lib/completions_to_review/insmod.exp delete mode 100644 test/lib/completions_to_review/invoke-rc.d.exp delete mode 100644 test/lib/completions_to_review/irb.exp delete mode 100644 test/lib/completions_to_review/isql.exp delete mode 100644 test/lib/completions_to_review/iwconfig.exp delete mode 100644 test/lib/completions_to_review/iwlist.exp delete mode 100644 test/lib/completions_to_review/iwpriv.exp delete mode 100644 test/lib/completions_to_review/iwspy.exp diff --git a/contrib/info b/contrib/info index 745d3e1a..c6c142e5 100644 --- a/contrib/info +++ b/contrib/info @@ -6,7 +6,7 @@ have info && _info() { - local cur infopath + local cur i infopath COMPREPLY=() cur=`_get_cword` diff --git a/test/_completion_to_review/head.exp b/test/_completion_to_review/head.exp deleted file mode 100644 index 6f38543b..00000000 --- a/test/_completion_to_review/head.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/head.exp" diff --git a/test/_completion_to_review/hg.exp b/test/_completion_to_review/hg.exp deleted file mode 100644 index 0c6aae13..00000000 --- a/test/_completion_to_review/hg.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/hg.exp" diff --git a/test/_completion_to_review/iconv.exp b/test/_completion_to_review/iconv.exp deleted file mode 100644 index 5c2cfbd8..00000000 --- a/test/_completion_to_review/iconv.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/iconv.exp" diff --git a/test/_completion_to_review/id.exp b/test/_completion_to_review/id.exp deleted file mode 100644 index 2aca482b..00000000 --- a/test/_completion_to_review/id.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/id.exp" diff --git a/test/_completion_to_review/identify.exp b/test/_completion_to_review/identify.exp deleted file mode 100644 index 0bbbacfb..00000000 --- a/test/_completion_to_review/identify.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/identify.exp" diff --git a/test/_completion_to_review/ifdown.exp b/test/_completion_to_review/ifdown.exp deleted file mode 100644 index b2776e22..00000000 --- a/test/_completion_to_review/ifdown.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ifdown.exp" diff --git a/test/_completion_to_review/ifup.exp b/test/_completion_to_review/ifup.exp deleted file mode 100644 index fc1957ab..00000000 --- a/test/_completion_to_review/ifup.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ifup.exp" diff --git a/test/_completion_to_review/indent.exp b/test/_completion_to_review/indent.exp deleted file mode 100644 index db4cde24..00000000 --- a/test/_completion_to_review/indent.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/indent.exp" diff --git a/test/_completion_to_review/info.exp b/test/_completion_to_review/info.exp deleted file mode 100644 index 32429d90..00000000 --- a/test/_completion_to_review/info.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/info.exp" diff --git a/test/_completion_to_review/inject.exp b/test/_completion_to_review/inject.exp deleted file mode 100644 index cf3c1951..00000000 --- a/test/_completion_to_review/inject.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/inject.exp" diff --git a/test/_completion_to_review/insmod.exp b/test/_completion_to_review/insmod.exp deleted file mode 100644 index da1aab8d..00000000 --- a/test/_completion_to_review/insmod.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/insmod.exp" diff --git a/test/_completion_to_review/invoke-rc.d.exp b/test/_completion_to_review/invoke-rc.d.exp deleted file mode 100644 index 5093383c..00000000 --- a/test/_completion_to_review/invoke-rc.d.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/invoke-rc.d.exp" diff --git a/test/_completion_to_review/irb.exp b/test/_completion_to_review/irb.exp deleted file mode 100644 index e598d868..00000000 --- a/test/_completion_to_review/irb.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/irb.exp" diff --git a/test/_completion_to_review/isql.exp b/test/_completion_to_review/isql.exp deleted file mode 100644 index b324b1ae..00000000 --- a/test/_completion_to_review/isql.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/isql.exp" diff --git a/test/completion/head.exp b/test/completion/head.exp new file mode 100644 index 00000000..fe064acf --- /dev/null +++ b/test/completion/head.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {head}]} { + source "lib/completions/head.exp" +}; # if diff --git a/test/completion/iconv.exp b/test/completion/iconv.exp new file mode 100644 index 00000000..8e21c8a2 --- /dev/null +++ b/test/completion/iconv.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {iconv}]} { + source "lib/completions/iconv.exp" +}; # if diff --git a/test/completion/id.exp b/test/completion/id.exp new file mode 100644 index 00000000..e5b963ed --- /dev/null +++ b/test/completion/id.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {id}]} { + source "lib/completions/id.exp" +}; # if diff --git a/test/completion/identify.exp b/test/completion/identify.exp new file mode 100644 index 00000000..ed4197e3 --- /dev/null +++ b/test/completion/identify.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {convert}]} { + source "lib/completions/identify.exp" +}; # if diff --git a/test/completion/ifdown.exp b/test/completion/ifdown.exp new file mode 100644 index 00000000..ca83edb4 --- /dev/null +++ b/test/completion/ifdown.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {ifdown}]} { + source "lib/completions/ifdown.exp" +}; # if diff --git a/test/completion/ifup.exp b/test/completion/ifup.exp new file mode 100644 index 00000000..5018e6e2 --- /dev/null +++ b/test/completion/ifup.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {ifup}]} { + source "lib/completions/ifup.exp" +}; # if diff --git a/test/completion/indent.exp b/test/completion/indent.exp new file mode 100644 index 00000000..d618f90c --- /dev/null +++ b/test/completion/indent.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {indent}]} { + source "lib/completions/indent.exp" +}; # if diff --git a/test/completion/info.exp b/test/completion/info.exp new file mode 100644 index 00000000..82a93280 --- /dev/null +++ b/test/completion/info.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {info}]} { + source "lib/completions/info.exp" +}; # if diff --git a/test/completion/inject.exp b/test/completion/inject.exp new file mode 100644 index 00000000..af6bc61c --- /dev/null +++ b/test/completion/inject.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {inject}]} { + source "lib/completions/inject.exp" +}; # if diff --git a/test/completion/insmod.exp b/test/completion/insmod.exp new file mode 100644 index 00000000..e86b6ce8 --- /dev/null +++ b/test/completion/insmod.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {insmod}]} { + source "lib/completions/insmod.exp" +}; # if diff --git a/test/completion/invoke-rc.d.exp b/test/completion/invoke-rc.d.exp new file mode 100644 index 00000000..6540317e --- /dev/null +++ b/test/completion/invoke-rc.d.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {invoke-rc.d}]} { + source "lib/completions/invoke-rc.d.exp" +}; # if diff --git a/test/completion/irb.exp b/test/completion/irb.exp new file mode 100644 index 00000000..e621b78a --- /dev/null +++ b/test/completion/irb.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {irb}]} { + source "lib/completions/irb.exp" +}; # if diff --git a/test/completion/isql.exp b/test/completion/isql.exp new file mode 100644 index 00000000..7cd318cd --- /dev/null +++ b/test/completion/isql.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {isql}]} { + source "lib/completions/isql.exp" +}; # if diff --git a/test/_completion_to_review/iwconfig.exp b/test/completion/iwconfig.exp similarity index 100% rename from test/_completion_to_review/iwconfig.exp rename to test/completion/iwconfig.exp diff --git a/test/_completion_to_review/iwlist.exp b/test/completion/iwlist.exp similarity index 100% rename from test/_completion_to_review/iwlist.exp rename to test/completion/iwlist.exp diff --git a/test/_completion_to_review/iwpriv.exp b/test/completion/iwpriv.exp similarity index 100% rename from test/_completion_to_review/iwpriv.exp rename to test/completion/iwpriv.exp diff --git a/test/_completion_to_review/iwspy.exp b/test/completion/iwspy.exp similarity index 100% rename from test/_completion_to_review/iwspy.exp rename to test/completion/iwspy.exp diff --git a/test/fixtures/isql/odbc.ini b/test/fixtures/isql/odbc.ini new file mode 100644 index 00000000..96319f3b --- /dev/null +++ b/test/fixtures/isql/odbc.ini @@ -0,0 +1,3 @@ +[foo] + +[bar] diff --git a/test/lib/completions/head.exp b/test/lib/completions/head.exp new file mode 100644 index 00000000..9782f5ef --- /dev/null +++ b/test/lib/completions/head.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "head --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/iconv.exp b/test/lib/completions/iconv.exp new file mode 100644 index 00000000..0089533b --- /dev/null +++ b/test/lib/completions/iconv.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "iconv " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/id.exp b/test/lib/completions/id.exp new file mode 100644 index 00000000..155af52c --- /dev/null +++ b/test/lib/completions/id.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "id -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/identify.exp b/test/lib/completions/identify.exp new file mode 100644 index 00000000..8f38ae47 --- /dev/null +++ b/test/lib/completions/identify.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "identify -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ifdown.exp b/test/lib/completions/ifdown.exp new file mode 100644 index 00000000..68225bb9 --- /dev/null +++ b/test/lib/completions/ifdown.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ifdown " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ifup.exp b/test/lib/completions/ifup.exp new file mode 100644 index 00000000..9d717178 --- /dev/null +++ b/test/lib/completions/ifup.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ifup " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/indent.exp b/test/lib/completions/indent.exp new file mode 100644 index 00000000..e8fc32b1 --- /dev/null +++ b/test/lib/completions/indent.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "indent --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/info.exp b/test/lib/completions/info.exp new file mode 100644 index 00000000..ed769f1a --- /dev/null +++ b/test/lib/completions/info.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "info " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/inject.exp b/test/lib/completions/inject.exp new file mode 100644 index 00000000..7c093146 --- /dev/null +++ b/test/lib/completions/inject.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "inject " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/insmod.exp b/test/lib/completions/insmod.exp new file mode 100644 index 00000000..8e83f0b4 --- /dev/null +++ b/test/lib/completions/insmod.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "insmod in" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/invoke-rc.d.exp b/test/lib/completions/invoke-rc.d.exp new file mode 100644 index 00000000..4dc9f1d8 --- /dev/null +++ b/test/lib/completions/invoke-rc.d.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "invoke-rc.d " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/irb.exp b/test/lib/completions/irb.exp new file mode 100644 index 00000000..81bea6d2 --- /dev/null +++ b/test/lib/completions/irb.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "irb " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/isql.exp b/test/lib/completions/isql.exp new file mode 100644 index 00000000..87e16bca --- /dev/null +++ b/test/lib/completions/isql.exp @@ -0,0 +1,23 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/ODBCINI=/d} +}; # teardown() + + +setup + + +assert_bash_exec {OLDODBCINI=$ODBCINI; ODBCINI=$TESTDIR/fixtures/isql/odbc.ini} +assert_complete_any "isql " +sync_after_int +assert_bash_exec {ODBCINI=$OLDODBCINI; unset -v OLDODBCINI} + + +sync_after_int + + +teardown diff --git a/test/lib/completions/iwconfig.exp b/test/lib/completions/iwconfig.exp new file mode 100644 index 00000000..f09719d7 --- /dev/null +++ b/test/lib/completions/iwconfig.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "iwconfig --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/iwlist.exp b/test/lib/completions/iwlist.exp new file mode 100644 index 00000000..80a2c367 --- /dev/null +++ b/test/lib/completions/iwlist.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "iwlist --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/iwpriv.exp b/test/lib/completions/iwpriv.exp new file mode 100644 index 00000000..f3102cc5 --- /dev/null +++ b/test/lib/completions/iwpriv.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "iwpriv --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/iwspy.exp b/test/lib/completions/iwspy.exp new file mode 100644 index 00000000..5fa0bee5 --- /dev/null +++ b/test/lib/completions/iwspy.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_env_unmodified "iwspy --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/head.exp b/test/lib/completions_to_review/head.exp deleted file mode 100644 index cb504c06..00000000 --- a/test/lib/completions_to_review/head.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "head " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/hg.exp b/test/lib/completions_to_review/hg.exp deleted file mode 100644 index 9f09878d..00000000 --- a/test/lib/completions_to_review/hg.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "hg -R " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/iconv.exp b/test/lib/completions_to_review/iconv.exp deleted file mode 100644 index 654772a3..00000000 --- a/test/lib/completions_to_review/iconv.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "iconv " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/id.exp b/test/lib/completions_to_review/id.exp deleted file mode 100644 index 0ac76682..00000000 --- a/test/lib/completions_to_review/id.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "id " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/identify.exp b/test/lib/completions_to_review/identify.exp deleted file mode 100644 index 918c843d..00000000 --- a/test/lib/completions_to_review/identify.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "identify " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ifdown.exp b/test/lib/completions_to_review/ifdown.exp deleted file mode 100644 index 7f1a42be..00000000 --- a/test/lib/completions_to_review/ifdown.exp +++ /dev/null @@ -1,27 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ifdown " -send "$cmd\t" -expect { - -re "^$cmd.*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sleep .5 -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ifup.exp b/test/lib/completions_to_review/ifup.exp deleted file mode 100644 index 69918aeb..00000000 --- a/test/lib/completions_to_review/ifup.exp +++ /dev/null @@ -1,44 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should show completions" - # Try completion -set cmd "ifup " -send "$cmd\t" -expect { - -re "^$cmd.*\r\n/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -set test "Argument should complete" - # Set test function for _configured_interfaces() -set cmd "_configured_interfaces() { COMPREPLY=( foo bar ); }" -send "$cmd\r" -expect -ex "$cmd\r\n/@" - # Try completion -set cmd "ifup f" -send "$cmd\t" -expect { - -re "^${cmd}oo\\s*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/indent.exp b/test/lib/completions_to_review/indent.exp deleted file mode 100644 index e8a8e16e..00000000 --- a/test/lib/completions_to_review/indent.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "indent " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/info.exp b/test/lib/completions_to_review/info.exp deleted file mode 100644 index 0903da7d..00000000 --- a/test/lib/completions_to_review/info.exp +++ /dev/null @@ -1,31 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "info " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -# Interrupt command - -set test "Sync after QUIT/INT" -sleep 0.01 -send \031\003 -expect -ex /@ - - -teardown diff --git a/test/lib/completions_to_review/inject.exp b/test/lib/completions_to_review/inject.exp deleted file mode 100644 index 3ddd21d1..00000000 --- a/test/lib/completions_to_review/inject.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "inject " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/insmod.exp b/test/lib/completions_to_review/insmod.exp deleted file mode 100644 index ea41251b..00000000 --- a/test/lib/completions_to_review/insmod.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should show completions" - # Try completion -set cmd "insmod in" -send "$cmd\t" -expect { - -re "$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/invoke-rc.d.exp b/test/lib/completions_to_review/invoke-rc.d.exp deleted file mode 100644 index dc1e2623..00000000 --- a/test/lib/completions_to_review/invoke-rc.d.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "invoke-rc.d " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/irb.exp b/test/lib/completions_to_review/irb.exp deleted file mode 100644 index 7adaacdb..00000000 --- a/test/lib/completions_to_review/irb.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "irb " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/isql.exp b/test/lib/completions_to_review/isql.exp deleted file mode 100644 index 02eb540a..00000000 --- a/test/lib/completions_to_review/isql.exp +++ /dev/null @@ -1,34 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should show completions" - # Try completion -set cmd "isql " -send "$cmd\t" -expect { - # TODO: If $ODBCINI is set, match completions - # -- FVu, Fri Feb 27 22:58:05 CET 2009 - -re "^$cmd.*" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - - # Because we don't wait for prompt (/@), wait a moment - # for `comp_load' to install real completion. This can - # be removed if the TODO above is fixed. - # -- FVu, Fri Feb 27 23:14:49 CET 2009 -sleep .5 - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/iwconfig.exp b/test/lib/completions_to_review/iwconfig.exp deleted file mode 100644 index 38fffd17..00000000 --- a/test/lib/completions_to_review/iwconfig.exp +++ /dev/null @@ -1,40 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "iwconfig --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -set test "Tab should not complain about _available_interfaces() not being available" - # Try completion -set cmd "iwconfig #" -send "$cmd\t" -expect { - -re "^$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/iwlist.exp b/test/lib/completions_to_review/iwlist.exp deleted file mode 100644 index 39898472..00000000 --- a/test/lib/completions_to_review/iwlist.exp +++ /dev/null @@ -1,31 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "iwlist --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -# Interrupt command - -set test "Sync after INT" -sleep 0.01 -send \031\003; # QUIT/INT -expect -ex /@ - - -teardown diff --git a/test/lib/completions_to_review/iwpriv.exp b/test/lib/completions_to_review/iwpriv.exp deleted file mode 100644 index 971b28f8..00000000 --- a/test/lib/completions_to_review/iwpriv.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "iwpriv --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/iwspy.exp b/test/lib/completions_to_review/iwspy.exp deleted file mode 100644 index 62f11d39..00000000 --- a/test/lib/completions_to_review/iwspy.exp +++ /dev/null @@ -1,31 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "iwspy --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -# Interrupt command - -set test "Sync after QUIT/INT" -sleep 0.01 -send \031\003; # QUIT/INT -expect -ex /@ - - -teardown diff --git a/test/lib/library.exp b/test/lib/library.exp index f5043ffa..3d927325 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -134,13 +134,23 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} { # Escape special regexp characters regsub -all {([\[\]\(\)\.\\\+])} $cmd {\\\1} cmd expect { + -timeout 1 + # Match completions, multiple words # NOTE: The `\S*' (zero or more non-whitespace characters) matches a - # possible enlargement of a command's partial completion if the - # list of completions have a larger common prefix. + # longest common prefix of the completions shown. # E.g. `fmt -' becomes `fmt --' (two dashes) when completing -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" } + timeout { + expect { + # Match completion, single word. This word is shown on the + # same line as the command. + -re "^\\w+ $" { pass "$test" } + # Try matching multiple words again, with new timeout + -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" } + } + } -re $prompt { unresolved "$test at prompt" } - -re eof { unresolved "eof" } + eof { unresolved "eof" } }; # expect }; # assert_complete_any() From f1f61ace512295bb8b9ce77f7b26baeb8922469c Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sun, 19 Jul 2009 14:48:55 +0200 Subject: [PATCH 16/69] Reviewed tests j* & k* --- test/_completion_to_review/javac.exp | 1 - test/_completion_to_review/javadoc.exp | 1 - test/_completion_to_review/killall.exp | 1 - test/_completion_to_review/kldload.exp | 1 - test/_completion_to_review/kldunload.exp | 1 - test/_completion_to_review/kplayer.exp | 1 - .../java.exp | 0 test/completion/javac.exp | 3 + test/completion/javadoc.exp | 3 + test/completion/kdvi.exp | 1 + .../kill.exp | 0 test/completion/killall.exp | 3 + test/completion/kldload.exp | 3 + test/completion/kldunload.exp | 3 + test/completion/kpdf.exp | 1 + test/completion/kplayer.exp | 3 + test/fixtures/kdvi/.DVI | 0 test/fixtures/kdvi/.DVI.Z | 0 test/fixtures/kdvi/.DVI.bz2 | 0 test/fixtures/kdvi/.DVI.gz | 0 test/fixtures/kdvi/.dvi | 0 test/fixtures/kdvi/.dvi.Z | 0 test/fixtures/kdvi/.dvi.bz2 | 0 test/fixtures/kdvi/.dvi.gz | 0 test/fixtures/kdvi/.txt | 0 test/fixtures/kpdf/.EPS | 0 test/fixtures/kpdf/.PDF | 0 test/fixtures/kpdf/.PS | 0 test/fixtures/kpdf/.eps | 0 test/fixtures/kpdf/.pdf | 0 test/fixtures/kpdf/.ps | 0 test/fixtures/kpdf/.txt | 0 test/lib/completions/evince.exp | 9 +- test/lib/completions/java.exp | 20 ++++ test/lib/completions/javac.exp | 20 ++++ test/lib/completions/javadoc.exp | 20 ++++ test/lib/completions/kdvi.exp | 27 +++++ test/lib/completions/kill.exp | 24 ++++ test/lib/completions/killall.exp | 26 +++++ test/lib/completions/kldload.exp | 20 ++++ test/lib/completions/kldunload.exp | 20 ++++ test/lib/completions/kpdf.exp | 26 +++++ test/lib/completions/kplayer.exp | 20 ++++ test/lib/completions_to_review/java.exp | 26 ----- test/lib/completions_to_review/javac.exp | 26 ----- test/lib/completions_to_review/javadoc.exp | 26 ----- test/lib/completions_to_review/kdvi.exp | 35 ------ test/lib/completions_to_review/kill.exp | 40 ------- test/lib/completions_to_review/killall.exp | 40 ------- test/lib/completions_to_review/kldload.exp | 28 ----- test/lib/completions_to_review/kldunload.exp | 28 ----- test/lib/completions_to_review/kpdf.exp | 35 ------ test/lib/completions_to_review/kplayer.exp | 26 ----- test/lib/library.exp | 104 ++++++++++++------ 54 files changed, 320 insertions(+), 352 deletions(-) delete mode 100644 test/_completion_to_review/javac.exp delete mode 100644 test/_completion_to_review/javadoc.exp delete mode 100644 test/_completion_to_review/killall.exp delete mode 100644 test/_completion_to_review/kldload.exp delete mode 100644 test/_completion_to_review/kldunload.exp delete mode 100644 test/_completion_to_review/kplayer.exp rename test/{_completion_to_review => completion}/java.exp (100%) create mode 100644 test/completion/javac.exp create mode 100644 test/completion/javadoc.exp create mode 100644 test/completion/kdvi.exp rename test/{_completion_to_review => completion}/kill.exp (100%) create mode 100644 test/completion/killall.exp create mode 100644 test/completion/kldload.exp create mode 100644 test/completion/kldunload.exp create mode 100644 test/completion/kpdf.exp create mode 100644 test/completion/kplayer.exp create mode 100644 test/fixtures/kdvi/.DVI create mode 100644 test/fixtures/kdvi/.DVI.Z create mode 100644 test/fixtures/kdvi/.DVI.bz2 create mode 100644 test/fixtures/kdvi/.DVI.gz create mode 100644 test/fixtures/kdvi/.dvi create mode 100644 test/fixtures/kdvi/.dvi.Z create mode 100644 test/fixtures/kdvi/.dvi.bz2 create mode 100644 test/fixtures/kdvi/.dvi.gz create mode 100644 test/fixtures/kdvi/.txt create mode 100644 test/fixtures/kpdf/.EPS create mode 100644 test/fixtures/kpdf/.PDF create mode 100644 test/fixtures/kpdf/.PS create mode 100644 test/fixtures/kpdf/.eps create mode 100644 test/fixtures/kpdf/.pdf create mode 100644 test/fixtures/kpdf/.ps create mode 100644 test/fixtures/kpdf/.txt create mode 100644 test/lib/completions/java.exp create mode 100644 test/lib/completions/javac.exp create mode 100644 test/lib/completions/javadoc.exp create mode 100644 test/lib/completions/kdvi.exp create mode 100644 test/lib/completions/kill.exp create mode 100644 test/lib/completions/killall.exp create mode 100644 test/lib/completions/kldload.exp create mode 100644 test/lib/completions/kldunload.exp create mode 100644 test/lib/completions/kpdf.exp create mode 100644 test/lib/completions/kplayer.exp delete mode 100644 test/lib/completions_to_review/java.exp delete mode 100644 test/lib/completions_to_review/javac.exp delete mode 100644 test/lib/completions_to_review/javadoc.exp delete mode 100644 test/lib/completions_to_review/kdvi.exp delete mode 100644 test/lib/completions_to_review/kill.exp delete mode 100644 test/lib/completions_to_review/killall.exp delete mode 100644 test/lib/completions_to_review/kldload.exp delete mode 100644 test/lib/completions_to_review/kldunload.exp delete mode 100644 test/lib/completions_to_review/kpdf.exp delete mode 100644 test/lib/completions_to_review/kplayer.exp diff --git a/test/_completion_to_review/javac.exp b/test/_completion_to_review/javac.exp deleted file mode 100644 index 21516c7b..00000000 --- a/test/_completion_to_review/javac.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/javac.exp" diff --git a/test/_completion_to_review/javadoc.exp b/test/_completion_to_review/javadoc.exp deleted file mode 100644 index b89b8fc4..00000000 --- a/test/_completion_to_review/javadoc.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/javadoc.exp" diff --git a/test/_completion_to_review/killall.exp b/test/_completion_to_review/killall.exp deleted file mode 100644 index bbc59539..00000000 --- a/test/_completion_to_review/killall.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/killall.exp" diff --git a/test/_completion_to_review/kldload.exp b/test/_completion_to_review/kldload.exp deleted file mode 100644 index 4b36f499..00000000 --- a/test/_completion_to_review/kldload.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/kldload.exp" diff --git a/test/_completion_to_review/kldunload.exp b/test/_completion_to_review/kldunload.exp deleted file mode 100644 index d971f36a..00000000 --- a/test/_completion_to_review/kldunload.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/kldunload.exp" diff --git a/test/_completion_to_review/kplayer.exp b/test/_completion_to_review/kplayer.exp deleted file mode 100644 index 9c983665..00000000 --- a/test/_completion_to_review/kplayer.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/kplayer.exp" diff --git a/test/_completion_to_review/java.exp b/test/completion/java.exp similarity index 100% rename from test/_completion_to_review/java.exp rename to test/completion/java.exp diff --git a/test/completion/javac.exp b/test/completion/javac.exp new file mode 100644 index 00000000..0b8de5f4 --- /dev/null +++ b/test/completion/javac.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {javac}]} { + source "lib/completions/javac.exp" +}; # if diff --git a/test/completion/javadoc.exp b/test/completion/javadoc.exp new file mode 100644 index 00000000..995c92d7 --- /dev/null +++ b/test/completion/javadoc.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {javadoc}]} { + source "lib/completions/javadoc.exp" +}; # if diff --git a/test/completion/kdvi.exp b/test/completion/kdvi.exp new file mode 100644 index 00000000..d68cc8bb --- /dev/null +++ b/test/completion/kdvi.exp @@ -0,0 +1 @@ +source "lib/completions/kdvi.exp" diff --git a/test/_completion_to_review/kill.exp b/test/completion/kill.exp similarity index 100% rename from test/_completion_to_review/kill.exp rename to test/completion/kill.exp diff --git a/test/completion/killall.exp b/test/completion/killall.exp new file mode 100644 index 00000000..125ec383 --- /dev/null +++ b/test/completion/killall.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {killall}]} { + source "lib/completions/killall.exp" +}; # if diff --git a/test/completion/kldload.exp b/test/completion/kldload.exp new file mode 100644 index 00000000..3d9daaa6 --- /dev/null +++ b/test/completion/kldload.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {kldload}]} { + source "lib/completions/kldload.exp" +}; # if diff --git a/test/completion/kldunload.exp b/test/completion/kldunload.exp new file mode 100644 index 00000000..7c22ec4a --- /dev/null +++ b/test/completion/kldunload.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {kldunload}]} { + source "lib/completions/kldunload.exp" +}; # if diff --git a/test/completion/kpdf.exp b/test/completion/kpdf.exp new file mode 100644 index 00000000..610c2775 --- /dev/null +++ b/test/completion/kpdf.exp @@ -0,0 +1 @@ +source "lib/completions/kpdf.exp" diff --git a/test/completion/kplayer.exp b/test/completion/kplayer.exp new file mode 100644 index 00000000..1663f26c --- /dev/null +++ b/test/completion/kplayer.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {mplayer}]} { + source "lib/completions/kplayer.exp" +}; # if diff --git a/test/fixtures/kdvi/.DVI b/test/fixtures/kdvi/.DVI new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kdvi/.DVI.Z b/test/fixtures/kdvi/.DVI.Z new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kdvi/.DVI.bz2 b/test/fixtures/kdvi/.DVI.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kdvi/.DVI.gz b/test/fixtures/kdvi/.DVI.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kdvi/.dvi b/test/fixtures/kdvi/.dvi new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kdvi/.dvi.Z b/test/fixtures/kdvi/.dvi.Z new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kdvi/.dvi.bz2 b/test/fixtures/kdvi/.dvi.bz2 new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kdvi/.dvi.gz b/test/fixtures/kdvi/.dvi.gz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kdvi/.txt b/test/fixtures/kdvi/.txt new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kpdf/.EPS b/test/fixtures/kpdf/.EPS new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kpdf/.PDF b/test/fixtures/kpdf/.PDF new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kpdf/.PS b/test/fixtures/kpdf/.PS new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kpdf/.eps b/test/fixtures/kpdf/.eps new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kpdf/.pdf b/test/fixtures/kpdf/.pdf new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kpdf/.ps b/test/fixtures/kpdf/.ps new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/kpdf/.txt b/test/fixtures/kpdf/.txt new file mode 100644 index 00000000..e69de29b diff --git a/test/lib/completions/evince.exp b/test/lib/completions/evince.exp index 527a9958..22279a26 100644 --- a/test/lib/completions/evince.exp +++ b/test/lib/completions/evince.exp @@ -26,11 +26,10 @@ set files { .tga .TGA .tif .TIF .tiff .TIFF .xpm .XPM .xwd .XWD } -set prompt "/fixtures/evince/@" -assert_bash_exec "cd fixtures/evince" "" $prompt -assert_complete $files "evince " "" $prompt -sync_after_int $prompt -assert_bash_exec "cd \$TESTDIR" +assert_complete_dir $files "evince " "fixtures/evince" + + +sync_after_int teardown diff --git a/test/lib/completions/java.exp b/test/lib/completions/java.exp new file mode 100644 index 00000000..f14d84ad --- /dev/null +++ b/test/lib/completions/java.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "java -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/javac.exp b/test/lib/completions/javac.exp new file mode 100644 index 00000000..6013de11 --- /dev/null +++ b/test/lib/completions/javac.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "javac " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/javadoc.exp b/test/lib/completions/javadoc.exp new file mode 100644 index 00000000..40c922ca --- /dev/null +++ b/test/lib/completions/javadoc.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "javadoc " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/kdvi.exp b/test/lib/completions/kdvi.exp new file mode 100644 index 00000000..0196049a --- /dev/null +++ b/test/lib/completions/kdvi.exp @@ -0,0 +1,27 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +# NOTE: The directory `fixtures/kdvi' contains an additional subdir `foo' +# (should be visible as completion) and an additional file `.txt' +# (shouldn't be visible as completion) +set files { + foo/ + .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz .DVI.gz .dvi.Z .DVI.Z +} +assert_complete_dir $files "kdvi " "fixtures/kdvi" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/kill.exp b/test/lib/completions/kill.exp new file mode 100644 index 00000000..62d6b85b --- /dev/null +++ b/test/lib/completions/kill.exp @@ -0,0 +1,24 @@ +proc setup {} { +}; # setup() + + +proc teardown {} { +}; # teardown() + + +setup + + +assert_complete_any "kill 1" + + +sync_after_int + + +assert_complete [get_signals] "kill -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/killall.exp b/test/lib/completions/killall.exp new file mode 100644 index 00000000..763c8e7d --- /dev/null +++ b/test/lib/completions/killall.exp @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "killall " + + +sync_after_int + + +assert_complete [get_signals] "killall -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/kldload.exp b/test/lib/completions/kldload.exp new file mode 100644 index 00000000..0493a10a --- /dev/null +++ b/test/lib/completions/kldload.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "kldload " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/kldunload.exp b/test/lib/completions/kldunload.exp new file mode 100644 index 00000000..4a20aa62 --- /dev/null +++ b/test/lib/completions/kldunload.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "kldunload " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/kpdf.exp b/test/lib/completions/kpdf.exp new file mode 100644 index 00000000..010abcfb --- /dev/null +++ b/test/lib/completions/kpdf.exp @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +# NOTE: The directory `fixtures/kpdf' contains an additional subdir `foo' +# (should be visible as completion) and an additional file `.txt' +# (shouldn't be visible as completion) +set files { + foo/ .eps .ps .EPS .PS .pdf .PDF +} +assert_complete_dir $files "kpdf " "fixtures/kpdf" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/kplayer.exp b/test/lib/completions/kplayer.exp new file mode 100644 index 00000000..34c9b3bf --- /dev/null +++ b/test/lib/completions/kplayer.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "kplayer " + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/java.exp b/test/lib/completions_to_review/java.exp deleted file mode 100644 index 30b42b41..00000000 --- a/test/lib/completions_to_review/java.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "java -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/javac.exp b/test/lib/completions_to_review/javac.exp deleted file mode 100644 index 0c0e4210..00000000 --- a/test/lib/completions_to_review/javac.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "javac " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/javadoc.exp b/test/lib/completions_to_review/javadoc.exp deleted file mode 100644 index 9da75764..00000000 --- a/test/lib/completions_to_review/javadoc.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "javadoc " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/kdvi.exp b/test/lib/completions_to_review/kdvi.exp deleted file mode 100644 index 73a12c59..00000000 --- a/test/lib/completions_to_review/kdvi.exp +++ /dev/null @@ -1,35 +0,0 @@ -proc setup {} { - set test setup - set cmd "touch fixture1/t.{dvi{,.gz,.bz2},DVI{,.gz,.bz2}}"; # Create temporary files - send "$cmd\r" - expect -ex "$cmd\r\n/@" -}; # setup() - - -proc teardown {} { - set test teardown - set cmd "rm fixture1/t.{dvi{,.gz,.bz2},DVI{,.gz,.bz2}}"; # Remove temporary files - send "$cmd\r" - expect -ex "$cmd\r\n/@" -}; # teardown() - - -setup - - -set test "Tab should complete kdvi" - # Try completion -set cmd "kdvi fixture1/" -send "$cmd\t" -expect { - -re "^${cmd}\r\n(\.svn/ +|)bar bar.d/ +foo.d/ +(\.svn/ +|)t.dvi +t.DVI +t.dvi.bz2 +t.DVI.bz2 +t.dvi.gz +t.DVI.gz *\r\n/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -#sleep .5 -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/kill.exp b/test/lib/completions_to_review/kill.exp deleted file mode 100644 index 60da2978..00000000 --- a/test/lib/completions_to_review/kill.exp +++ /dev/null @@ -1,40 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should show completions" - # Try completion -set cmd "kill 1" -send "$cmd\t" -expect { - -re "$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -set test "Tab should show signals" - # Try completion -set cmd "kill -" -send "$cmd\t" -expect { - -re "$cmd\r\n.*-KILL.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/killall.exp b/test/lib/completions_to_review/killall.exp deleted file mode 100644 index f1e20ad2..00000000 --- a/test/lib/completions_to_review/killall.exp +++ /dev/null @@ -1,40 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should show completions" - # Try completion -set cmd "killall " -send "$cmd\t" -expect { - -re "$cmd\r\n.*/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -set test "Tab should complete signals" - # Try completion -set cmd "killall -" -send "$cmd\t" -expect { - -re "$cmd\r\n.*-KILL.*/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/kldload.exp b/test/lib/completions_to_review/kldload.exp deleted file mode 100644 index f7839d2f..00000000 --- a/test/lib/completions_to_review/kldload.exp +++ /dev/null @@ -1,28 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "kldload " -send "$cmd\t" -sync_after_tab -expect { - -re "^$cmd.*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sleep .4 -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/kldunload.exp b/test/lib/completions_to_review/kldunload.exp deleted file mode 100644 index 88262bd1..00000000 --- a/test/lib/completions_to_review/kldunload.exp +++ /dev/null @@ -1,28 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "kldunload " -send "$cmd\t" -sync_after_tab -expect { - -re "^$cmd.*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sleep .4 -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/kpdf.exp b/test/lib/completions_to_review/kpdf.exp deleted file mode 100644 index 39facb7f..00000000 --- a/test/lib/completions_to_review/kpdf.exp +++ /dev/null @@ -1,35 +0,0 @@ -proc setup {} { - set test setup - set cmd "touch fixture1/t.{pdf,PDF,{,e}ps,{,E}PS}"; # Create temporary files - send "$cmd\r" - expect -ex "$cmd\r\n/@" -}; # setup() - - -proc teardown {} { - set test teardown - set cmd "rm fixture1/t.{pdf,PDF,{,e}ps,{,E}PS}"; # Remove temporary files - send "$cmd\r" - expect -ex "$cmd\r\n/@" -}; # teardown() - - -setup - - -set test "Tab should complete kpdf" - # Try completion -set cmd "kpdf fixture1/" -send "$cmd\t" -expect { - -re "^${cmd}\r\n(\.svn/ +|)bar bar.d/ +foo.d/ +(\.svn/ +|)t.eps +t.EPS +t.pdf +t.PDF +t.ps +t.PS *\r\n/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -sleep .5 -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/kplayer.exp b/test/lib/completions_to_review/kplayer.exp deleted file mode 100644 index 48d365cb..00000000 --- a/test/lib/completions_to_review/kplayer.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "kplayer " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/library.exp b/test/lib/library.exp index 3d927325..968c4323 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -54,7 +54,6 @@ proc assert_bash_type {command} { # Make sure the expected items are returned by TAB-completing the specified # command. -# Break items into chunks because `expect' seems to have a limited buffer size # @param list $expected # @param string $cmd Command given to generate items # @param string $test (optional) Test titel. Default is "$cmd should show completions" @@ -98,34 +97,6 @@ proc assert_complete {expected cmd {test ""} {prompt /@} {size 20}} { }; # assert_complete() -# Make sure a partial argument is completed. -# A completion is tried with `$partial', or if this is empty, the first -# character of the first item of `$expected'. Only the items from $expected, -# starting with this character are then expected as completions. -# @param list $expected List of all completions. -# @param string $cmd Command given to generate items -# @param string $test (optional) Test titel. Default is "$cmd should show completions" -# @param string $prompt (optional) Bash prompt. Default is "/@" -# @param integer $size (optional) Chunk size. Default is 20. -# @result boolean True if successful, False if not -proc assert_complete_partial {expected cmd {partial ""} {test ""} {prompt /@} {size 20}} { - if {$test == ""} {set test "$cmd should complete partial argument"} - if {[llength $expected] == 0} { - unresolved "$test" - } else { - set pick {} - foreach item $expected { - if {$partial == ""} {set partial [string range $item 0 0]} - # Only append item if starting with $partial - if {[string range $item 0 [expr [string length $partial] - 1]] == "$partial"} { - lappend pick $item - }; # if - }; # foreach - assert_complete $pick "$cmd $partial" $test $prompt $size - }; # if -}; # assert_complete_partial() - - # Make sure any completions are returned proc assert_complete_any {cmd {test ""} {prompt /@}} { if {$test == ""} {set test "$cmd should show completions"} @@ -155,6 +126,53 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} { }; # assert_complete_any() +# Make sure the expected files are returned by TAB-completing the +# specified command in the specified subdirectory. +# @param list $expected +# @param string $cmd Command given to generate items +# @param string $dir Subdirectory to attempt completion in. The directory must be relative from the $TESTDIR and without a trailing slash. E.g. `fixtures/evince' +# @param string $test (optional) Test titel. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" +# @param integer $size (optional) Chunk size. Default is 20. +# @result boolean True if successful, False if not +proc assert_complete_dir {expected cmd dir {test ""} {size 20}} { + set prompt "/$dir/@" + assert_bash_exec "cd $dir" "" $prompt + assert_complete $expected $cmd $test $prompt $size + sync_after_int $prompt + assert_bash_exec "cd \$TESTDIR" +}; # assert_complete_dir + + + +# Make sure a partial argument is completed. +# A completion is tried with `$partial', or if this is empty, the first +# character of the first item of `$expected'. Only the items from $expected, +# starting with this character are then expected as completions. +# @param list $expected List of all completions. +# @param string $cmd Command given to generate items +# @param string $test (optional) Test titel. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" +# @param integer $size (optional) Chunk size. Default is 20. +# @result boolean True if successful, False if not +proc assert_complete_partial {expected cmd {partial ""} {test ""} {prompt /@} {size 20}} { + if {$test == ""} {set test "$cmd should complete partial argument"} + if {[llength $expected] == 0} { + unresolved "$test" + } else { + set pick {} + foreach item $expected { + if {$partial == ""} {set partial [string range $item 0 0]} + # Only append item if starting with $partial + if {[string range $item 0 [expr [string length $partial] - 1]] == "$partial"} { + lappend pick $item + }; # if + }; # foreach + assert_complete $pick "$cmd $partial" $test $prompt $size + }; # if +}; # assert_complete_partial() + + # Make sure the bash environment hasn't changed between now and the last call # to `save_env()'. # @param string $sed Sed commands to preprocess diff output. @@ -248,7 +266,7 @@ proc assert_exec {cmd {stdout ''} {test ''}} { }; # assert_exec() -# Get known hostnames +# Get hostnames # @return list Hostnames proc get_hosts {} { set hosts [exec bash -c "compgen -A hostname"] @@ -266,6 +284,25 @@ proc get_hosts {} { }; # get_hosts() +# Get signals +# This function is written in analogy to the bash function `_signals()' in +# `bash_completion'. +# @return list Signals starting with `SIG', but with the `SIG' prefix removed. +proc get_signals {} { + set signals {} + foreach signal [exec bash -c {compgen -A signal}] { + # Does signal start with `SIG'? + if {[string range $signal 0 [expr [string length "SIG"] - 1]] == "SIG"} { + # Remove `SIG' prefix + set signal [string range $signal 3 end] + # Add signal (with dash (-) prefix) to list + lappend signals -$signal + }; # if + }; # foreach + return $signals +}; # get_signals() + + # Expect items. # Break items into chunks because `expect' seems to have a limited buffer size # @param list $items @@ -368,7 +405,12 @@ proc sync_after_int {{prompt /@}} { set test "Sync after INT" sleep .1 send \031\003; # QUIT/INT - expect $prompt + # NOTE: Regexp `.*' causes `expect' to discard previous unknown output. + # This is necessary if a completion doesn't match expectations. + # For instance with `filetype_xpec' completion (e.g. `kdvi') if + # one expects `.txt' as a completion (wrong, because it isn't + # there), the unmatched completions need to be cleaned up. + expect -re ".*$prompt$" }; # sync_after_int() From d3d1a9f895f77f1e540d206ef4f0d826a5149a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 20 Jul 2009 19:57:36 +0300 Subject: [PATCH 17/69] Add xz, xzcat, xzdec, and unxz completion. --- CHANGES | 1 + Makefile.am | 1 + bash_completion | 1 + contrib/xz | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 contrib/xz diff --git a/CHANGES b/CHANGES index 59131021..e226c032 100644 --- a/CHANGES +++ b/CHANGES @@ -94,6 +94,7 @@ bash-completion (1.x) * Associate .tsv with oocalc. * Add xmlwf completion. * Associate *.po with poedit, gtranslator, kbabel, and lokalize. + * Add xz, xzcat, xzdec, and unxz completion. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/Makefile.am b/Makefile.am index 3c808914..d9036329 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,6 +140,7 @@ bashcomp_DATA = contrib/ant \ contrib/xmlwf \ contrib/xmms \ contrib/xrandr \ + contrib/xz \ contrib/yp-tools \ contrib/yum diff --git a/bash_completion b/bash_completion index f1ccb202..f9736160 100644 --- a/bash_completion +++ b/bash_completion @@ -107,6 +107,7 @@ complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip #complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore complete -f -X '!*.*' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore complete -f -X '!*.Z' uncompress +complete -f -X '!*.xz' unxz xzcat complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' ee complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.bz2|.BZ2|.Z))' gv ggv kghostview diff --git a/contrib/xz b/contrib/xz new file mode 100644 index 00000000..fb6089d6 --- /dev/null +++ b/contrib/xz @@ -0,0 +1,99 @@ +# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*- +# ex: ts=8 sw=8 noet filetype=sh + +# xz(1) completion +# +have xz && +_xz() +{ + COMPREPLY=() + local cur=`_get_cword` + local prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-z --compress -d --decompress \ + -t --test -l --list -k --keep -f --force -c --stdout \ + -S --suffix --files --files0 -F --format -C --check \ + -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -M --memory --lzma1 \ + --lzma2 --x86 --powerpc --ia64 --arm --armthumb \ + --sparc --delta -q --quiet -v --verbose -h --help \ + -H --long-help -V --version' -- $cur ) ) + return 0 + fi + + local split=false + _split_longopt && split=true + + local xspec="*.xz" + + case "$prev" in + -@(!(-*)[dlt]*|-decompress|-list|-test)) + xspec="!"$xspec + ;; + --files|--files0) + _filedir + return 0 + ;; + -C|--check) + COMPREPLY=( $( compgen -W 'crc32 crc64 sha256' \ + -- $cur ) ) + return 0 + ;; + -F|--format) + COMPREPLY=( $( compgen -W 'auto xz lzma raw' -- $cur ) ) + return 0 + ;; + -M|--memory|-S|--suffix|--delta|--lzma1|--lzma2) + # argument required but no completions available + return 0 + ;; + -h|--help|-H|--long-help|-V|--version) + # all other arguments are noop with these + return 0 + ;; + esac + + $split && return 0 + + _expand || return 0 + + local IFS=$'\t\n' + COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \ + $( compgen -d -- $cur ) ) +} && +complete -F _xz $filenames xz + +# xzdec(1) completion +# +have xzdec && +_xzdec() +{ + COMPREPLY=() + local cur=`_get_cword` + local prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-M --memory -h --help -V --version' \ + -- $cur ) ) + return 0 + fi + + local split=false + _split_longopt && split=true + + case "$prev" in + -M|--memory) + # argument required but no completions available + return 0 + ;; + -h|--help|-V|--version) + # all other arguments are noop with these + return 0 + ;; + esac + + $split && return 0 + + _filedir xz +} && +complete -F _xzdec $filenames xzdec From 06eed586ee8f52db8641b302bfe371a4053b0f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 20 Jul 2009 20:00:33 +0300 Subject: [PATCH 18/69] Add lzcat and unlzma completion. --- CHANGES | 1 + bash_completion | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index e226c032..03d1350a 100644 --- a/CHANGES +++ b/CHANGES @@ -95,6 +95,7 @@ bash-completion (1.x) * Add xmlwf completion. * Associate *.po with poedit, gtranslator, kbabel, and lokalize. * Add xz, xzcat, xzdec, and unxz completion. + * Add lzcat and unlzma completion. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/bash_completion b/bash_completion index f9736160..75162a06 100644 --- a/bash_completion +++ b/bash_completion @@ -107,6 +107,7 @@ complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip #complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore complete -f -X '!*.*' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore complete -f -X '!*.Z' uncompress +complete -f -X '!*.lzma' lzcat unlzma complete -f -X '!*.xz' unxz xzcat complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' ee complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv From 9bb02ca317ccc89c318d2b2ad1423b1638076023 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Mon, 20 Jul 2009 21:13:58 +0200 Subject: [PATCH 19/69] Reviewed tests l* --- test/_completion_to_review/larch.exp | 1 - test/_completion_to_review/ld.exp | 1 - test/_completion_to_review/ldd.exp | 1 - test/_completion_to_review/less.exp | 1 - test/_completion_to_review/lftp.exp | 1 - test/_completion_to_review/links.exp | 1 - test/_completion_to_review/lisp.exp | 1 - test/_completion_to_review/list_admins.exp | 1 - test/_completion_to_review/list_lists.exp | 1 - test/_completion_to_review/list_members.exp | 1 - test/_completion_to_review/list_owners.exp | 1 - test/_completion_to_review/ln.exp | 1 - test/_completion_to_review/look.exp | 1 - test/_completion_to_review/ls.exp | 1 - test/completion/.ld.exp.swp | Bin 0 -> 12288 bytes test/completion/larch.exp | 3 ++ test/completion/ld.exp | 3 ++ test/completion/ldd.exp | 3 ++ test/completion/less.exp | 3 ++ test/completion/lftp.exp | 3 ++ .../lilo.exp | 0 test/completion/links.exp | 3 ++ test/completion/lisp.exp | 3 ++ test/completion/list_admins.exp | 3 ++ test/completion/list_lists.exp | 3 ++ test/completion/list_members.exp | 3 ++ test/completion/list_owners.exp | 3 ++ test/completion/ln.exp | 3 ++ test/completion/look.exp | 3 ++ test/completion/ls.exp | 3 ++ .../lvchange.exp | 0 .../lvcreate.exp | 0 .../lvdisplay.exp | 0 .../lvextend.exp | 0 .../lvm.exp | 0 .../lvmdiskscan.exp | 0 .../lvreduce.exp | 0 .../lvremove.exp | 0 .../lvrename.exp | 0 .../lvresize.exp | 0 .../lvs.exp | 0 .../lvscan.exp | 0 test/lib/completions/.ld.exp.swp | Bin 0 -> 12288 bytes test/lib/completions/larch.exp | 20 ++++++++++++ test/lib/completions/ld.exp | 20 ++++++++++++ test/lib/completions/ldd.exp | 20 ++++++++++++ test/lib/completions/less.exp | 20 ++++++++++++ test/lib/completions/lftp.exp | 20 ++++++++++++ test/lib/completions/lilo.exp | 20 ++++++++++++ test/lib/completions/links.exp | 20 ++++++++++++ test/lib/completions/lisp.exp | 20 ++++++++++++ test/lib/completions/list_admins.exp | 20 ++++++++++++ test/lib/completions/list_lists.exp | 20 ++++++++++++ test/lib/completions/list_members.exp | 20 ++++++++++++ test/lib/completions/list_owners.exp | 20 ++++++++++++ test/lib/completions/ln.exp | 20 ++++++++++++ test/lib/completions/look.exp | 20 ++++++++++++ test/lib/completions/ls.exp | 20 ++++++++++++ test/lib/completions/lvchange.exp | 20 ++++++++++++ test/lib/completions/lvcreate.exp | 20 ++++++++++++ test/lib/completions/lvdisplay.exp | 20 ++++++++++++ test/lib/completions/lvextend.exp | 20 ++++++++++++ test/lib/completions/lvm.exp | 20 ++++++++++++ test/lib/completions/lvmdiskscan.exp | 20 ++++++++++++ test/lib/completions/lvreduce.exp | 20 ++++++++++++ test/lib/completions/lvremove.exp | 20 ++++++++++++ test/lib/completions/lvrename.exp | 20 ++++++++++++ test/lib/completions/lvresize.exp | 20 ++++++++++++ test/lib/completions/lvs.exp | 20 ++++++++++++ test/lib/completions/lvscan.exp | 20 ++++++++++++ test/lib/completions_to_review/larch.exp | 26 ---------------- test/lib/completions_to_review/ld.exp | 26 ---------------- test/lib/completions_to_review/ldd.exp | 26 ---------------- test/lib/completions_to_review/less.exp | 26 ---------------- test/lib/completions_to_review/lftp.exp | 26 ---------------- test/lib/completions_to_review/lilo.exp | 26 ---------------- test/lib/completions_to_review/links.exp | 26 ---------------- test/lib/completions_to_review/lisp.exp | 26 ---------------- .../lib/completions_to_review/list_admins.exp | 26 ---------------- test/lib/completions_to_review/list_lists.exp | 26 ---------------- .../completions_to_review/list_members.exp | 26 ---------------- .../lib/completions_to_review/list_owners.exp | 26 ---------------- test/lib/completions_to_review/ln.exp | 26 ---------------- test/lib/completions_to_review/look.exp | 29 ------------------ test/lib/completions_to_review/ls.exp | 26 ---------------- test/lib/completions_to_review/lvchange.exp | 26 ---------------- test/lib/completions_to_review/lvcreate.exp | 26 ---------------- test/lib/completions_to_review/lvdisplay.exp | 26 ---------------- test/lib/completions_to_review/lvextend.exp | 26 ---------------- test/lib/completions_to_review/lvm.exp | 26 ---------------- .../lib/completions_to_review/lvmdiskscan.exp | 26 ---------------- test/lib/completions_to_review/lvreduce.exp | 26 ---------------- test/lib/completions_to_review/lvremove.exp | 26 ---------------- test/lib/completions_to_review/lvrename.exp | 26 ---------------- test/lib/completions_to_review/lvresize.exp | 26 ---------------- test/lib/completions_to_review/lvs.exp | 26 ---------------- test/lib/completions_to_review/lvscan.exp | 26 ---------------- 97 files changed, 582 insertions(+), 719 deletions(-) delete mode 100644 test/_completion_to_review/larch.exp delete mode 100644 test/_completion_to_review/ld.exp delete mode 100644 test/_completion_to_review/ldd.exp delete mode 100644 test/_completion_to_review/less.exp delete mode 100644 test/_completion_to_review/lftp.exp delete mode 100644 test/_completion_to_review/links.exp delete mode 100644 test/_completion_to_review/lisp.exp delete mode 100644 test/_completion_to_review/list_admins.exp delete mode 100644 test/_completion_to_review/list_lists.exp delete mode 100644 test/_completion_to_review/list_members.exp delete mode 100644 test/_completion_to_review/list_owners.exp delete mode 100644 test/_completion_to_review/ln.exp delete mode 100644 test/_completion_to_review/look.exp delete mode 100644 test/_completion_to_review/ls.exp create mode 100644 test/completion/.ld.exp.swp create mode 100644 test/completion/larch.exp create mode 100644 test/completion/ld.exp create mode 100644 test/completion/ldd.exp create mode 100644 test/completion/less.exp create mode 100644 test/completion/lftp.exp rename test/{_completion_to_review => completion}/lilo.exp (100%) create mode 100644 test/completion/links.exp create mode 100644 test/completion/lisp.exp create mode 100644 test/completion/list_admins.exp create mode 100644 test/completion/list_lists.exp create mode 100644 test/completion/list_members.exp create mode 100644 test/completion/list_owners.exp create mode 100644 test/completion/ln.exp create mode 100644 test/completion/look.exp create mode 100644 test/completion/ls.exp rename test/{_completion_to_review => completion}/lvchange.exp (100%) rename test/{_completion_to_review => completion}/lvcreate.exp (100%) rename test/{_completion_to_review => completion}/lvdisplay.exp (100%) rename test/{_completion_to_review => completion}/lvextend.exp (100%) rename test/{_completion_to_review => completion}/lvm.exp (100%) rename test/{_completion_to_review => completion}/lvmdiskscan.exp (100%) rename test/{_completion_to_review => completion}/lvreduce.exp (100%) rename test/{_completion_to_review => completion}/lvremove.exp (100%) rename test/{_completion_to_review => completion}/lvrename.exp (100%) rename test/{_completion_to_review => completion}/lvresize.exp (100%) rename test/{_completion_to_review => completion}/lvs.exp (100%) rename test/{_completion_to_review => completion}/lvscan.exp (100%) create mode 100644 test/lib/completions/.ld.exp.swp create mode 100644 test/lib/completions/larch.exp create mode 100644 test/lib/completions/ld.exp create mode 100644 test/lib/completions/ldd.exp create mode 100644 test/lib/completions/less.exp create mode 100644 test/lib/completions/lftp.exp create mode 100644 test/lib/completions/lilo.exp create mode 100644 test/lib/completions/links.exp create mode 100644 test/lib/completions/lisp.exp create mode 100644 test/lib/completions/list_admins.exp create mode 100644 test/lib/completions/list_lists.exp create mode 100644 test/lib/completions/list_members.exp create mode 100644 test/lib/completions/list_owners.exp create mode 100644 test/lib/completions/ln.exp create mode 100644 test/lib/completions/look.exp create mode 100644 test/lib/completions/ls.exp create mode 100644 test/lib/completions/lvchange.exp create mode 100644 test/lib/completions/lvcreate.exp create mode 100644 test/lib/completions/lvdisplay.exp create mode 100644 test/lib/completions/lvextend.exp create mode 100644 test/lib/completions/lvm.exp create mode 100644 test/lib/completions/lvmdiskscan.exp create mode 100644 test/lib/completions/lvreduce.exp create mode 100644 test/lib/completions/lvremove.exp create mode 100644 test/lib/completions/lvrename.exp create mode 100644 test/lib/completions/lvresize.exp create mode 100644 test/lib/completions/lvs.exp create mode 100644 test/lib/completions/lvscan.exp delete mode 100644 test/lib/completions_to_review/larch.exp delete mode 100644 test/lib/completions_to_review/ld.exp delete mode 100644 test/lib/completions_to_review/ldd.exp delete mode 100644 test/lib/completions_to_review/less.exp delete mode 100644 test/lib/completions_to_review/lftp.exp delete mode 100644 test/lib/completions_to_review/lilo.exp delete mode 100644 test/lib/completions_to_review/links.exp delete mode 100644 test/lib/completions_to_review/lisp.exp delete mode 100644 test/lib/completions_to_review/list_admins.exp delete mode 100644 test/lib/completions_to_review/list_lists.exp delete mode 100644 test/lib/completions_to_review/list_members.exp delete mode 100644 test/lib/completions_to_review/list_owners.exp delete mode 100644 test/lib/completions_to_review/ln.exp delete mode 100644 test/lib/completions_to_review/look.exp delete mode 100644 test/lib/completions_to_review/ls.exp delete mode 100644 test/lib/completions_to_review/lvchange.exp delete mode 100644 test/lib/completions_to_review/lvcreate.exp delete mode 100644 test/lib/completions_to_review/lvdisplay.exp delete mode 100644 test/lib/completions_to_review/lvextend.exp delete mode 100644 test/lib/completions_to_review/lvm.exp delete mode 100644 test/lib/completions_to_review/lvmdiskscan.exp delete mode 100644 test/lib/completions_to_review/lvreduce.exp delete mode 100644 test/lib/completions_to_review/lvremove.exp delete mode 100644 test/lib/completions_to_review/lvrename.exp delete mode 100644 test/lib/completions_to_review/lvresize.exp delete mode 100644 test/lib/completions_to_review/lvs.exp delete mode 100644 test/lib/completions_to_review/lvscan.exp diff --git a/test/_completion_to_review/larch.exp b/test/_completion_to_review/larch.exp deleted file mode 100644 index bad7768e..00000000 --- a/test/_completion_to_review/larch.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/larch.exp" diff --git a/test/_completion_to_review/ld.exp b/test/_completion_to_review/ld.exp deleted file mode 100644 index c2285cbc..00000000 --- a/test/_completion_to_review/ld.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ld.exp" diff --git a/test/_completion_to_review/ldd.exp b/test/_completion_to_review/ldd.exp deleted file mode 100644 index fe9c4002..00000000 --- a/test/_completion_to_review/ldd.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ldd.exp" diff --git a/test/_completion_to_review/less.exp b/test/_completion_to_review/less.exp deleted file mode 100644 index f58cd99b..00000000 --- a/test/_completion_to_review/less.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/less.exp" diff --git a/test/_completion_to_review/lftp.exp b/test/_completion_to_review/lftp.exp deleted file mode 100644 index 16d1c95b..00000000 --- a/test/_completion_to_review/lftp.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/lftp.exp" diff --git a/test/_completion_to_review/links.exp b/test/_completion_to_review/links.exp deleted file mode 100644 index 776bedda..00000000 --- a/test/_completion_to_review/links.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/links.exp" diff --git a/test/_completion_to_review/lisp.exp b/test/_completion_to_review/lisp.exp deleted file mode 100644 index ddd6ad58..00000000 --- a/test/_completion_to_review/lisp.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/lisp.exp" diff --git a/test/_completion_to_review/list_admins.exp b/test/_completion_to_review/list_admins.exp deleted file mode 100644 index f4ec2f54..00000000 --- a/test/_completion_to_review/list_admins.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/list_admins.exp" diff --git a/test/_completion_to_review/list_lists.exp b/test/_completion_to_review/list_lists.exp deleted file mode 100644 index 705c4d57..00000000 --- a/test/_completion_to_review/list_lists.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/list_lists.exp" diff --git a/test/_completion_to_review/list_members.exp b/test/_completion_to_review/list_members.exp deleted file mode 100644 index 4618c03d..00000000 --- a/test/_completion_to_review/list_members.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/list_members.exp" diff --git a/test/_completion_to_review/list_owners.exp b/test/_completion_to_review/list_owners.exp deleted file mode 100644 index 8f66acbd..00000000 --- a/test/_completion_to_review/list_owners.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/list_owners.exp" diff --git a/test/_completion_to_review/ln.exp b/test/_completion_to_review/ln.exp deleted file mode 100644 index 70d31ffe..00000000 --- a/test/_completion_to_review/ln.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ln.exp" diff --git a/test/_completion_to_review/look.exp b/test/_completion_to_review/look.exp deleted file mode 100644 index 57ed96b4..00000000 --- a/test/_completion_to_review/look.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/look.exp" diff --git a/test/_completion_to_review/ls.exp b/test/_completion_to_review/ls.exp deleted file mode 100644 index 6b78b68e..00000000 --- a/test/_completion_to_review/ls.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ls.exp" diff --git a/test/completion/.ld.exp.swp b/test/completion/.ld.exp.swp new file mode 100644 index 0000000000000000000000000000000000000000..a5ba7407c0117394ce6a70fcf628794f4f5a3682 GIT binary patch literal 12288 zcmeI&u}Z^G6oBDVog75b(dC+s(xlcw!O=k!9CZ;XNpqu-vSbP^xN zC()Y{R4CNVq5KC9$vyX6LcTFMLI3LPLLIsTv9T#~`WBu)ukFdxj!2a2Fq}3Ui=&(! zUfk2{dgF=lvOK-_0>8LBNyk~DO`J|<%iidF?cT=5GrBO|Pt8k0S3hKbKZFhh5SSMz zP1HMDmxIB6zw7L(?XAoC9x4bRfB*srAb&M_M^a9Q+!WFWPx|N8(6T*M3px+zgws`=Oa;T2)C{-_)v- EFWZJkBme*a literal 0 HcmV?d00001 diff --git a/test/completion/larch.exp b/test/completion/larch.exp new file mode 100644 index 00000000..26aef713 --- /dev/null +++ b/test/completion/larch.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {larch}]} { + source "lib/completions/larch.exp" +}; # if diff --git a/test/completion/ld.exp b/test/completion/ld.exp new file mode 100644 index 00000000..92527909 --- /dev/null +++ b/test/completion/ld.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {ld}]} { + source "lib/completions/ld.exp" +}; # if diff --git a/test/completion/ldd.exp b/test/completion/ldd.exp new file mode 100644 index 00000000..20c6fec6 --- /dev/null +++ b/test/completion/ldd.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {ldd}]} { + source "lib/completions/ldd.exp" +}; # if diff --git a/test/completion/less.exp b/test/completion/less.exp new file mode 100644 index 00000000..7ef11573 --- /dev/null +++ b/test/completion/less.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {less}]} { + source "lib/completions/less.exp" +}; # if diff --git a/test/completion/lftp.exp b/test/completion/lftp.exp new file mode 100644 index 00000000..847c6b31 --- /dev/null +++ b/test/completion/lftp.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {lftp}]} { + source "lib/completions/lftp.exp" +}; # if diff --git a/test/_completion_to_review/lilo.exp b/test/completion/lilo.exp similarity index 100% rename from test/_completion_to_review/lilo.exp rename to test/completion/lilo.exp diff --git a/test/completion/links.exp b/test/completion/links.exp new file mode 100644 index 00000000..7e871305 --- /dev/null +++ b/test/completion/links.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {links}]} { + source "lib/completions/links.exp" +}; # if diff --git a/test/completion/lisp.exp b/test/completion/lisp.exp new file mode 100644 index 00000000..90ac94fc --- /dev/null +++ b/test/completion/lisp.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {lisp}]} { + source "lib/completions/lisp.exp" +}; # if diff --git a/test/completion/list_admins.exp b/test/completion/list_admins.exp new file mode 100644 index 00000000..8a39e122 --- /dev/null +++ b/test/completion/list_admins.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {list_admins}]} { + source "lib/completions/list_admins.exp" +}; # if diff --git a/test/completion/list_lists.exp b/test/completion/list_lists.exp new file mode 100644 index 00000000..eb38985a --- /dev/null +++ b/test/completion/list_lists.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {list_lists}]} { + source "lib/completions/list_lists.exp" +}; # if diff --git a/test/completion/list_members.exp b/test/completion/list_members.exp new file mode 100644 index 00000000..bc6a6639 --- /dev/null +++ b/test/completion/list_members.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {list_members}]} { + source "lib/completions/list_members.exp" +}; # if diff --git a/test/completion/list_owners.exp b/test/completion/list_owners.exp new file mode 100644 index 00000000..0b02658d --- /dev/null +++ b/test/completion/list_owners.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {list_owners}]} { + source "lib/completions/list_owners.exp" +}; # if diff --git a/test/completion/ln.exp b/test/completion/ln.exp new file mode 100644 index 00000000..cd4b605d --- /dev/null +++ b/test/completion/ln.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {ln}]} { + source "lib/completions/ln.exp" +}; # if diff --git a/test/completion/look.exp b/test/completion/look.exp new file mode 100644 index 00000000..c99369b1 --- /dev/null +++ b/test/completion/look.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {look}]} { + source "lib/completions/look.exp" +}; # if diff --git a/test/completion/ls.exp b/test/completion/ls.exp new file mode 100644 index 00000000..e1fe643e --- /dev/null +++ b/test/completion/ls.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {ls}]} { + source "lib/completions/ls.exp" +}; # if diff --git a/test/_completion_to_review/lvchange.exp b/test/completion/lvchange.exp similarity index 100% rename from test/_completion_to_review/lvchange.exp rename to test/completion/lvchange.exp diff --git a/test/_completion_to_review/lvcreate.exp b/test/completion/lvcreate.exp similarity index 100% rename from test/_completion_to_review/lvcreate.exp rename to test/completion/lvcreate.exp diff --git a/test/_completion_to_review/lvdisplay.exp b/test/completion/lvdisplay.exp similarity index 100% rename from test/_completion_to_review/lvdisplay.exp rename to test/completion/lvdisplay.exp diff --git a/test/_completion_to_review/lvextend.exp b/test/completion/lvextend.exp similarity index 100% rename from test/_completion_to_review/lvextend.exp rename to test/completion/lvextend.exp diff --git a/test/_completion_to_review/lvm.exp b/test/completion/lvm.exp similarity index 100% rename from test/_completion_to_review/lvm.exp rename to test/completion/lvm.exp diff --git a/test/_completion_to_review/lvmdiskscan.exp b/test/completion/lvmdiskscan.exp similarity index 100% rename from test/_completion_to_review/lvmdiskscan.exp rename to test/completion/lvmdiskscan.exp diff --git a/test/_completion_to_review/lvreduce.exp b/test/completion/lvreduce.exp similarity index 100% rename from test/_completion_to_review/lvreduce.exp rename to test/completion/lvreduce.exp diff --git a/test/_completion_to_review/lvremove.exp b/test/completion/lvremove.exp similarity index 100% rename from test/_completion_to_review/lvremove.exp rename to test/completion/lvremove.exp diff --git a/test/_completion_to_review/lvrename.exp b/test/completion/lvrename.exp similarity index 100% rename from test/_completion_to_review/lvrename.exp rename to test/completion/lvrename.exp diff --git a/test/_completion_to_review/lvresize.exp b/test/completion/lvresize.exp similarity index 100% rename from test/_completion_to_review/lvresize.exp rename to test/completion/lvresize.exp diff --git a/test/_completion_to_review/lvs.exp b/test/completion/lvs.exp similarity index 100% rename from test/_completion_to_review/lvs.exp rename to test/completion/lvs.exp diff --git a/test/_completion_to_review/lvscan.exp b/test/completion/lvscan.exp similarity index 100% rename from test/_completion_to_review/lvscan.exp rename to test/completion/lvscan.exp diff --git a/test/lib/completions/.ld.exp.swp b/test/lib/completions/.ld.exp.swp new file mode 100644 index 0000000000000000000000000000000000000000..f018de376bd8556c7a4d150dd183459ad12e12ef GIT binary patch literal 12288 zcmeI&F;2rU6b4|Ioq~Xk#k30uwJBu)iIE8;MhaVSY6pT+C&X@{s(J)q0*-*h6_~gK zZ~-oWgv1IjXa?_V;v_nEJYmjuqgEU$8$>#rR+^)E^)#@KRmM7D;5mQqjT6eMx{Ck* zCR9KG0%HPg>sPjC*=BvCRxYjZ#f8JMWlSId0SG_<0uX=z1Rwx`=@+nZf&I`iXDCaQ zLLU0SfB*y_009U<00Izz00bZa0SG`~N(6*t?5oJw(HtF!{{K&Z1Nfxp56U~`jq*x) zp*&I^DEE{*$}Q!Fa!oOmgmOXgD1vfAN%w6~FdzT{2tWV=5P$##AOHafKmY<$C}5RH zWOS+NXr`;1uJEl&+(27;A&gOpb@O}e$`!iHOQGbYv{>18dcVED!^?cQ$?6*8H1a;B nJ8oOIA{qFBl8o-tH%FDc*XO-qd$w2JYeYx6)Hx{6RtB}dAo6hV literal 0 HcmV?d00001 diff --git a/test/lib/completions/larch.exp b/test/lib/completions/larch.exp new file mode 100644 index 00000000..076016f2 --- /dev/null +++ b/test/lib/completions/larch.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "larch library-" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ld.exp b/test/lib/completions/ld.exp new file mode 100644 index 00000000..60377991 --- /dev/null +++ b/test/lib/completions/ld.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ld " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ldd.exp b/test/lib/completions/ldd.exp new file mode 100644 index 00000000..e45d1df7 --- /dev/null +++ b/test/lib/completions/ldd.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ldd " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/less.exp b/test/lib/completions/less.exp new file mode 100644 index 00000000..269c9b5c --- /dev/null +++ b/test/lib/completions/less.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "less --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lftp.exp b/test/lib/completions/lftp.exp new file mode 100644 index 00000000..4bdde376 --- /dev/null +++ b/test/lib/completions/lftp.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lftp " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lilo.exp b/test/lib/completions/lilo.exp new file mode 100644 index 00000000..505a1470 --- /dev/null +++ b/test/lib/completions/lilo.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lilo -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/links.exp b/test/lib/completions/links.exp new file mode 100644 index 00000000..9f4896aa --- /dev/null +++ b/test/lib/completions/links.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "links " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lisp.exp b/test/lib/completions/lisp.exp new file mode 100644 index 00000000..21663628 --- /dev/null +++ b/test/lib/completions/lisp.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lisp " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/list_admins.exp b/test/lib/completions/list_admins.exp new file mode 100644 index 00000000..e1c9c4dd --- /dev/null +++ b/test/lib/completions/list_admins.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "list_admins -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/list_lists.exp b/test/lib/completions/list_lists.exp new file mode 100644 index 00000000..789ab1a8 --- /dev/null +++ b/test/lib/completions/list_lists.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "list_lists -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/list_members.exp b/test/lib/completions/list_members.exp new file mode 100644 index 00000000..c93b53d7 --- /dev/null +++ b/test/lib/completions/list_members.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "list_members -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/list_owners.exp b/test/lib/completions/list_owners.exp new file mode 100644 index 00000000..c96e0229 --- /dev/null +++ b/test/lib/completions/list_owners.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "list_owners -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ln.exp b/test/lib/completions/ln.exp new file mode 100644 index 00000000..34786071 --- /dev/null +++ b/test/lib/completions/ln.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ln " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/look.exp b/test/lib/completions/look.exp new file mode 100644 index 00000000..4224c32d --- /dev/null +++ b/test/lib/completions/look.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "look foo" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ls.exp b/test/lib/completions/ls.exp new file mode 100644 index 00000000..82e898c8 --- /dev/null +++ b/test/lib/completions/ls.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ls --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvchange.exp b/test/lib/completions/lvchange.exp new file mode 100644 index 00000000..ec3886b8 --- /dev/null +++ b/test/lib/completions/lvchange.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvchange --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvcreate.exp b/test/lib/completions/lvcreate.exp new file mode 100644 index 00000000..46dceb79 --- /dev/null +++ b/test/lib/completions/lvcreate.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvcreate --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvdisplay.exp b/test/lib/completions/lvdisplay.exp new file mode 100644 index 00000000..5a01a0e5 --- /dev/null +++ b/test/lib/completions/lvdisplay.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvdisplay --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvextend.exp b/test/lib/completions/lvextend.exp new file mode 100644 index 00000000..24a63853 --- /dev/null +++ b/test/lib/completions/lvextend.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvextend --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvm.exp b/test/lib/completions/lvm.exp new file mode 100644 index 00000000..1c67825e --- /dev/null +++ b/test/lib/completions/lvm.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvm pv" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvmdiskscan.exp b/test/lib/completions/lvmdiskscan.exp new file mode 100644 index 00000000..27e566d4 --- /dev/null +++ b/test/lib/completions/lvmdiskscan.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvmdiskscan --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvreduce.exp b/test/lib/completions/lvreduce.exp new file mode 100644 index 00000000..edd5150d --- /dev/null +++ b/test/lib/completions/lvreduce.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvreduce --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvremove.exp b/test/lib/completions/lvremove.exp new file mode 100644 index 00000000..1cd63150 --- /dev/null +++ b/test/lib/completions/lvremove.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvremove --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvrename.exp b/test/lib/completions/lvrename.exp new file mode 100644 index 00000000..51624222 --- /dev/null +++ b/test/lib/completions/lvrename.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvrename --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvresize.exp b/test/lib/completions/lvresize.exp new file mode 100644 index 00000000..830b9ab1 --- /dev/null +++ b/test/lib/completions/lvresize.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvresize --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvs.exp b/test/lib/completions/lvs.exp new file mode 100644 index 00000000..8b239f5d --- /dev/null +++ b/test/lib/completions/lvs.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvs --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/lvscan.exp b/test/lib/completions/lvscan.exp new file mode 100644 index 00000000..841fd0ed --- /dev/null +++ b/test/lib/completions/lvscan.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvscan --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/larch.exp b/test/lib/completions_to_review/larch.exp deleted file mode 100644 index aadd4615..00000000 --- a/test/lib/completions_to_review/larch.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "larch library-" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ld.exp b/test/lib/completions_to_review/ld.exp deleted file mode 100644 index 429250d6..00000000 --- a/test/lib/completions_to_review/ld.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ld " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ldd.exp b/test/lib/completions_to_review/ldd.exp deleted file mode 100644 index 42af5981..00000000 --- a/test/lib/completions_to_review/ldd.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ldd " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/less.exp b/test/lib/completions_to_review/less.exp deleted file mode 100644 index d833adee..00000000 --- a/test/lib/completions_to_review/less.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "less " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lftp.exp b/test/lib/completions_to_review/lftp.exp deleted file mode 100644 index eeac0c79..00000000 --- a/test/lib/completions_to_review/lftp.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lftp " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lilo.exp b/test/lib/completions_to_review/lilo.exp deleted file mode 100644 index b2f46019..00000000 --- a/test/lib/completions_to_review/lilo.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lilo -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/links.exp b/test/lib/completions_to_review/links.exp deleted file mode 100644 index e08e624c..00000000 --- a/test/lib/completions_to_review/links.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "links " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lisp.exp b/test/lib/completions_to_review/lisp.exp deleted file mode 100644 index 1afe40cc..00000000 --- a/test/lib/completions_to_review/lisp.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lisp " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/list_admins.exp b/test/lib/completions_to_review/list_admins.exp deleted file mode 100644 index 7006f9b5..00000000 --- a/test/lib/completions_to_review/list_admins.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "list_admins -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/list_lists.exp b/test/lib/completions_to_review/list_lists.exp deleted file mode 100644 index 332b0218..00000000 --- a/test/lib/completions_to_review/list_lists.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "list_lists -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/list_members.exp b/test/lib/completions_to_review/list_members.exp deleted file mode 100644 index 5d9dd085..00000000 --- a/test/lib/completions_to_review/list_members.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "list_members -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/list_owners.exp b/test/lib/completions_to_review/list_owners.exp deleted file mode 100644 index 065635b8..00000000 --- a/test/lib/completions_to_review/list_owners.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "list_owners -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ln.exp b/test/lib/completions_to_review/ln.exp deleted file mode 100644 index aa2faaa5..00000000 --- a/test/lib/completions_to_review/ln.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ln " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/look.exp b/test/lib/completions_to_review/look.exp deleted file mode 100644 index 38eb1a50..00000000 --- a/test/lib/completions_to_review/look.exp +++ /dev/null @@ -1,29 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "look foo " -send "$cmd\t" - # NOTE: Wait in case `look' returns nothing, so that "^$cdm.*$" doesn't match - # too early -- before comp_install has finished -sleep .4 -expect { - -re "^${cmd}(bash: look: command not found\r\n|)\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ls.exp b/test/lib/completions_to_review/ls.exp deleted file mode 100644 index d4332951..00000000 --- a/test/lib/completions_to_review/ls.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ls " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvchange.exp b/test/lib/completions_to_review/lvchange.exp deleted file mode 100644 index d07a129b..00000000 --- a/test/lib/completions_to_review/lvchange.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvchange --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvcreate.exp b/test/lib/completions_to_review/lvcreate.exp deleted file mode 100644 index 1a24d6a5..00000000 --- a/test/lib/completions_to_review/lvcreate.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvcreate --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvdisplay.exp b/test/lib/completions_to_review/lvdisplay.exp deleted file mode 100644 index 4ba2be5f..00000000 --- a/test/lib/completions_to_review/lvdisplay.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvdisplay --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvextend.exp b/test/lib/completions_to_review/lvextend.exp deleted file mode 100644 index 60195ce8..00000000 --- a/test/lib/completions_to_review/lvextend.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvextend --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvm.exp b/test/lib/completions_to_review/lvm.exp deleted file mode 100644 index e9403a41..00000000 --- a/test/lib/completions_to_review/lvm.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvm pv" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvmdiskscan.exp b/test/lib/completions_to_review/lvmdiskscan.exp deleted file mode 100644 index eb219e56..00000000 --- a/test/lib/completions_to_review/lvmdiskscan.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvmdiskscan --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvreduce.exp b/test/lib/completions_to_review/lvreduce.exp deleted file mode 100644 index 6c3f1411..00000000 --- a/test/lib/completions_to_review/lvreduce.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvreduce --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvremove.exp b/test/lib/completions_to_review/lvremove.exp deleted file mode 100644 index 35ba530d..00000000 --- a/test/lib/completions_to_review/lvremove.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvremove --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvrename.exp b/test/lib/completions_to_review/lvrename.exp deleted file mode 100644 index fd3102d3..00000000 --- a/test/lib/completions_to_review/lvrename.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvrename --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvresize.exp b/test/lib/completions_to_review/lvresize.exp deleted file mode 100644 index ce441983..00000000 --- a/test/lib/completions_to_review/lvresize.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvresize --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvs.exp b/test/lib/completions_to_review/lvs.exp deleted file mode 100644 index 231099eb..00000000 --- a/test/lib/completions_to_review/lvs.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvs --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/lvscan.exp b/test/lib/completions_to_review/lvscan.exp deleted file mode 100644 index e50a7f92..00000000 --- a/test/lib/completions_to_review/lvscan.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "lvscan --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From a490556a5bb379695eaeb37d18ad14e10c6dceec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 23 Jul 2009 00:37:33 +0300 Subject: [PATCH 20/69] Fix leaking $prev from _service(). --- CHANGES | 4 ++-- bash_completion | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 03d1350a..fc6faeaa 100644 --- a/CHANGES +++ b/CHANGES @@ -71,8 +71,8 @@ bash-completion (1.x) completion, assume only that --*file*= does, and that --*dir*= takes dirs. * Add make --old/new-file, --assume-old/new, --what-if value completions. * Add smartctl -n/--nocheck completion, add more other value completions. - * Fix leaking $prev from cpio, dsniff, freeciv, gkrellm, mkinitrd, and - tcpdump completions. + * Fix leaking $prev from cpio, dsniff, freeciv, gkrellm, mkinitrd, service, + and tcpdump completions. * Split ant completion to contrib/ant, improve the built in one. * Improve postfix completion. * Improve samba completion. diff --git a/bash_completion b/bash_completion index 75162a06..c17a5645 100644 --- a/bash_completion +++ b/bash_completion @@ -640,7 +640,7 @@ _usb_ids() { have service || [ -d /etc/init.d/ ]; } && _service() { - local cur sysvdir + local cur prev sysvdir COMPREPLY=() prev=${COMP_WORDS[COMP_CWORD-1]} From 6966cad8cf1eefc710aed20ab1b182d879613b3e Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 24 Jul 2009 09:07:32 +0200 Subject: [PATCH 21/69] Fix leaking $i from `man' completion --- CHANGES | 1 + contrib/man | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fc6faeaa..af990319 100644 --- a/CHANGES +++ b/CHANGES @@ -139,6 +139,7 @@ bash-completion (1.x) [ Freddy Vulto ] * Patched _known_hosts() to support multiple {Global,User}KnownHosts in SSH config files, thanks to Thomas Nilsson (Alioth: #311595) (Debian: #524190) + * Fix leaking $i from info and man completions. -- David Paleino Thu, 18 Jun 2009 13:12:36 +0200 diff --git a/contrib/man b/contrib/man index 1529d64c..1e409d33 100644 --- a/contrib/man +++ b/contrib/man @@ -8,7 +8,7 @@ -o $UNAME = OpenBSD ] && _man() { - local cur prev sect manpath manext mansect uname + local cur i prev sect manpath manext mansect uname manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@(gz|bz2|lzma))" mansect="@([0-9lnp]|[0-9][px]|3pm)" From 0d443835c4bb40c12d63f3b6c931568fbb516e11 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 24 Jul 2009 09:55:54 +0200 Subject: [PATCH 22/69] Reviewed tests m* --- test/_completion_to_review/m4.exp | 1 - test/_completion_to_review/macof.exp | 1 - test/_completion_to_review/mailmanctl.exp | 1 - test/_completion_to_review/mailsnarf.exp | 1 - test/_completion_to_review/man.exp | 1 - test/_completion_to_review/mc.exp | 1 - test/_completion_to_review/mcrypt.exp | 1 - test/_completion_to_review/md5sum.exp | 1 - test/_completion_to_review/mdecrypt.exp | 1 - test/_completion_to_review/mencoder.exp | 1 - test/_completion_to_review/mkdir.exp | 1 - test/_completion_to_review/mkfifo.exp | 1 - test/_completion_to_review/mkinitrd.exp | 1 - test/_completion_to_review/mkisofs.exp | 1 - test/_completion_to_review/mknod.exp | 1 - test/_completion_to_review/mmsitepass.exp | 1 - test/_completion_to_review/module.exp | 1 - test/_completion_to_review/mogrify.exp | 1 - test/_completion_to_review/montage.exp | 1 - test/_completion_to_review/msgsnarf.exp | 1 - test/_completion_to_review/mtx.exp | 1 - test/_completion_to_review/mutt.exp | 1 - test/_completion_to_review/muttng.exp | 1 - test/_completion_to_review/mv.exp | 1 - test/completion/.ld.exp.swp | Bin 12288 -> 0 bytes test/completion/m4.exp | 3 ++ test/completion/macof.exp | 3 ++ test/completion/mailmanctl.exp | 3 ++ test/completion/mailsnarf.exp | 3 ++ test/completion/man.exp | 3 ++ test/completion/mc.exp | 3 ++ test/completion/mcrypt.exp | 3 ++ test/completion/md5sum.exp | 3 ++ test/completion/mdecrypt.exp | 3 ++ test/completion/mencoder.exp | 3 ++ .../minicom.exp | 0 test/completion/mkdir.exp | 3 ++ test/completion/mkfifo.exp | 3 ++ test/completion/mkinitrd.exp | 3 ++ test/completion/mkisofs.exp | 3 ++ test/completion/mknod.exp | 3 ++ test/completion/mmsitepass.exp | 3 ++ test/completion/module.exp | 3 ++ test/completion/mogrify.exp | 3 ++ test/completion/montage.exp | 3 ++ test/completion/mplayer.exp | 4 ++- test/completion/msgsnarf.exp | 3 ++ test/completion/mtx.exp | 3 ++ test/completion/mutt.exp | 3 ++ test/completion/muttng.exp | 3 ++ test/completion/mv.exp | 3 ++ test/completion/mysqladmin.exp | 3 ++ test/lib/completions/.ld.exp.swp | Bin 12288 -> 0 bytes test/lib/completions/find.exp | 10 ++----- test/lib/completions/m4.exp | 20 ++++++++++++++ test/lib/completions/macof.exp | 20 ++++++++++++++ test/lib/completions/mailmanctl.exp | 20 ++++++++++++++ test/lib/completions/mailsnarf.exp | 20 ++++++++++++++ test/lib/completions/man.exp | 20 ++++++++++++++ test/lib/completions/mc.exp | 20 ++++++++++++++ test/lib/completions/mcrypt.exp | 20 ++++++++++++++ test/lib/completions/md5sum.exp | 20 ++++++++++++++ test/lib/completions/mdecrypt.exp | 20 ++++++++++++++ test/lib/completions/mencoder.exp | 20 ++++++++++++++ test/lib/completions/minicom.exp | 20 ++++++++++++++ test/lib/completions/mkdir.exp | 20 ++++++++++++++ test/lib/completions/mkfifo.exp | 20 ++++++++++++++ test/lib/completions/mkinitrd.exp | 20 ++++++++++++++ .../mkisofs.exp | 12 ++------ test/lib/completions/mknod.exp | 20 ++++++++++++++ test/lib/completions/mmsitepass.exp | 20 ++++++++++++++ test/lib/completions/module.exp | 20 ++++++++++++++ test/lib/completions/mogrify.exp | 20 ++++++++++++++ test/lib/completions/montage.exp | 20 ++++++++++++++ test/lib/completions/mplayer.exp | 10 +------ test/lib/completions/msgsnarf.exp | 20 ++++++++++++++ test/lib/completions/mtx.exp | 20 ++++++++++++++ test/lib/completions/mutt.exp | 20 ++++++++++++++ test/lib/completions/muttng.exp | 20 ++++++++++++++ test/lib/completions/mv.exp | 20 ++++++++++++++ test/lib/completions/mysqladmin.exp | 20 ++++++++++++++ test/lib/completions_to_review/m4.exp | 26 ------------------ test/lib/completions_to_review/macof.exp | 26 ------------------ test/lib/completions_to_review/mailmanctl.exp | 26 ------------------ test/lib/completions_to_review/mailsnarf.exp | 26 ------------------ test/lib/completions_to_review/man.exp | 26 ------------------ test/lib/completions_to_review/mc.exp | 26 ------------------ test/lib/completions_to_review/mcrypt.exp | 26 ------------------ test/lib/completions_to_review/md5sum.exp | 26 ------------------ test/lib/completions_to_review/mdecrypt.exp | 26 ------------------ test/lib/completions_to_review/mencoder.exp | 26 ------------------ test/lib/completions_to_review/minicom.exp | 26 ------------------ test/lib/completions_to_review/mkdir.exp | 26 ------------------ test/lib/completions_to_review/mkfifo.exp | 26 ------------------ test/lib/completions_to_review/mkinitrd.exp | 26 ------------------ test/lib/completions_to_review/mknod.exp | 26 ------------------ test/lib/completions_to_review/mmsitepass.exp | 26 ------------------ test/lib/completions_to_review/module.exp | 26 ------------------ test/lib/completions_to_review/mogrify.exp | 26 ------------------ test/lib/completions_to_review/montage.exp | 26 ------------------ test/lib/completions_to_review/msgsnarf.exp | 26 ------------------ test/lib/completions_to_review/mtx.exp | 26 ------------------ test/lib/completions_to_review/mutt.exp | 26 ------------------ test/lib/completions_to_review/muttng.exp | 26 ------------------ test/lib/completions_to_review/mv.exp | 26 ------------------ test/lib/completions_to_review/mysqladmin.exp | 26 ------------------ 106 files changed, 585 insertions(+), 700 deletions(-) delete mode 100644 test/_completion_to_review/m4.exp delete mode 100644 test/_completion_to_review/macof.exp delete mode 100644 test/_completion_to_review/mailmanctl.exp delete mode 100644 test/_completion_to_review/mailsnarf.exp delete mode 100644 test/_completion_to_review/man.exp delete mode 100644 test/_completion_to_review/mc.exp delete mode 100644 test/_completion_to_review/mcrypt.exp delete mode 100644 test/_completion_to_review/md5sum.exp delete mode 100644 test/_completion_to_review/mdecrypt.exp delete mode 100644 test/_completion_to_review/mencoder.exp delete mode 100644 test/_completion_to_review/mkdir.exp delete mode 100644 test/_completion_to_review/mkfifo.exp delete mode 100644 test/_completion_to_review/mkinitrd.exp delete mode 100644 test/_completion_to_review/mkisofs.exp delete mode 100644 test/_completion_to_review/mknod.exp delete mode 100644 test/_completion_to_review/mmsitepass.exp delete mode 100644 test/_completion_to_review/module.exp delete mode 100644 test/_completion_to_review/mogrify.exp delete mode 100644 test/_completion_to_review/montage.exp delete mode 100644 test/_completion_to_review/msgsnarf.exp delete mode 100644 test/_completion_to_review/mtx.exp delete mode 100644 test/_completion_to_review/mutt.exp delete mode 100644 test/_completion_to_review/muttng.exp delete mode 100644 test/_completion_to_review/mv.exp delete mode 100644 test/completion/.ld.exp.swp create mode 100644 test/completion/m4.exp create mode 100644 test/completion/macof.exp create mode 100644 test/completion/mailmanctl.exp create mode 100644 test/completion/mailsnarf.exp create mode 100644 test/completion/man.exp create mode 100644 test/completion/mc.exp create mode 100644 test/completion/mcrypt.exp create mode 100644 test/completion/md5sum.exp create mode 100644 test/completion/mdecrypt.exp create mode 100644 test/completion/mencoder.exp rename test/{_completion_to_review => completion}/minicom.exp (100%) create mode 100644 test/completion/mkdir.exp create mode 100644 test/completion/mkfifo.exp create mode 100644 test/completion/mkinitrd.exp create mode 100644 test/completion/mkisofs.exp create mode 100644 test/completion/mknod.exp create mode 100644 test/completion/mmsitepass.exp create mode 100644 test/completion/module.exp create mode 100644 test/completion/mogrify.exp create mode 100644 test/completion/montage.exp create mode 100644 test/completion/msgsnarf.exp create mode 100644 test/completion/mtx.exp create mode 100644 test/completion/mutt.exp create mode 100644 test/completion/muttng.exp create mode 100644 test/completion/mv.exp create mode 100644 test/completion/mysqladmin.exp delete mode 100644 test/lib/completions/.ld.exp.swp create mode 100644 test/lib/completions/m4.exp create mode 100644 test/lib/completions/macof.exp create mode 100644 test/lib/completions/mailmanctl.exp create mode 100644 test/lib/completions/mailsnarf.exp create mode 100644 test/lib/completions/man.exp create mode 100644 test/lib/completions/mc.exp create mode 100644 test/lib/completions/mcrypt.exp create mode 100644 test/lib/completions/md5sum.exp create mode 100644 test/lib/completions/mdecrypt.exp create mode 100644 test/lib/completions/mencoder.exp create mode 100644 test/lib/completions/minicom.exp create mode 100644 test/lib/completions/mkdir.exp create mode 100644 test/lib/completions/mkfifo.exp create mode 100644 test/lib/completions/mkinitrd.exp rename test/lib/{completions_to_review => completions}/mkisofs.exp (73%) create mode 100644 test/lib/completions/mknod.exp create mode 100644 test/lib/completions/mmsitepass.exp create mode 100644 test/lib/completions/module.exp create mode 100644 test/lib/completions/mogrify.exp create mode 100644 test/lib/completions/montage.exp create mode 100644 test/lib/completions/msgsnarf.exp create mode 100644 test/lib/completions/mtx.exp create mode 100644 test/lib/completions/mutt.exp create mode 100644 test/lib/completions/muttng.exp create mode 100644 test/lib/completions/mv.exp create mode 100644 test/lib/completions/mysqladmin.exp delete mode 100644 test/lib/completions_to_review/m4.exp delete mode 100644 test/lib/completions_to_review/macof.exp delete mode 100644 test/lib/completions_to_review/mailmanctl.exp delete mode 100644 test/lib/completions_to_review/mailsnarf.exp delete mode 100644 test/lib/completions_to_review/man.exp delete mode 100644 test/lib/completions_to_review/mc.exp delete mode 100644 test/lib/completions_to_review/mcrypt.exp delete mode 100644 test/lib/completions_to_review/md5sum.exp delete mode 100644 test/lib/completions_to_review/mdecrypt.exp delete mode 100644 test/lib/completions_to_review/mencoder.exp delete mode 100644 test/lib/completions_to_review/minicom.exp delete mode 100644 test/lib/completions_to_review/mkdir.exp delete mode 100644 test/lib/completions_to_review/mkfifo.exp delete mode 100644 test/lib/completions_to_review/mkinitrd.exp delete mode 100644 test/lib/completions_to_review/mknod.exp delete mode 100644 test/lib/completions_to_review/mmsitepass.exp delete mode 100644 test/lib/completions_to_review/module.exp delete mode 100644 test/lib/completions_to_review/mogrify.exp delete mode 100644 test/lib/completions_to_review/montage.exp delete mode 100644 test/lib/completions_to_review/msgsnarf.exp delete mode 100644 test/lib/completions_to_review/mtx.exp delete mode 100644 test/lib/completions_to_review/mutt.exp delete mode 100644 test/lib/completions_to_review/muttng.exp delete mode 100644 test/lib/completions_to_review/mv.exp delete mode 100644 test/lib/completions_to_review/mysqladmin.exp diff --git a/test/_completion_to_review/m4.exp b/test/_completion_to_review/m4.exp deleted file mode 100644 index c997e3d4..00000000 --- a/test/_completion_to_review/m4.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/m4.exp" diff --git a/test/_completion_to_review/macof.exp b/test/_completion_to_review/macof.exp deleted file mode 100644 index a07e4c14..00000000 --- a/test/_completion_to_review/macof.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/macof.exp" diff --git a/test/_completion_to_review/mailmanctl.exp b/test/_completion_to_review/mailmanctl.exp deleted file mode 100644 index d3bd1612..00000000 --- a/test/_completion_to_review/mailmanctl.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mailmanctl.exp" diff --git a/test/_completion_to_review/mailsnarf.exp b/test/_completion_to_review/mailsnarf.exp deleted file mode 100644 index 168e52c4..00000000 --- a/test/_completion_to_review/mailsnarf.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mailsnarf.exp" diff --git a/test/_completion_to_review/man.exp b/test/_completion_to_review/man.exp deleted file mode 100644 index 89e7264f..00000000 --- a/test/_completion_to_review/man.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/man.exp" diff --git a/test/_completion_to_review/mc.exp b/test/_completion_to_review/mc.exp deleted file mode 100644 index f01cf460..00000000 --- a/test/_completion_to_review/mc.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mc.exp" diff --git a/test/_completion_to_review/mcrypt.exp b/test/_completion_to_review/mcrypt.exp deleted file mode 100644 index 050d0b34..00000000 --- a/test/_completion_to_review/mcrypt.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mcrypt.exp" diff --git a/test/_completion_to_review/md5sum.exp b/test/_completion_to_review/md5sum.exp deleted file mode 100644 index 924c5c8f..00000000 --- a/test/_completion_to_review/md5sum.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/md5sum.exp" diff --git a/test/_completion_to_review/mdecrypt.exp b/test/_completion_to_review/mdecrypt.exp deleted file mode 100644 index ed843741..00000000 --- a/test/_completion_to_review/mdecrypt.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mdecrypt.exp" diff --git a/test/_completion_to_review/mencoder.exp b/test/_completion_to_review/mencoder.exp deleted file mode 100644 index 3d7a46bd..00000000 --- a/test/_completion_to_review/mencoder.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mencoder.exp" diff --git a/test/_completion_to_review/mkdir.exp b/test/_completion_to_review/mkdir.exp deleted file mode 100644 index 20697250..00000000 --- a/test/_completion_to_review/mkdir.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mkdir.exp" diff --git a/test/_completion_to_review/mkfifo.exp b/test/_completion_to_review/mkfifo.exp deleted file mode 100644 index 162d7f73..00000000 --- a/test/_completion_to_review/mkfifo.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mkfifo.exp" diff --git a/test/_completion_to_review/mkinitrd.exp b/test/_completion_to_review/mkinitrd.exp deleted file mode 100644 index 335401ea..00000000 --- a/test/_completion_to_review/mkinitrd.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mkinitrd.exp" diff --git a/test/_completion_to_review/mkisofs.exp b/test/_completion_to_review/mkisofs.exp deleted file mode 100644 index 11acbeb6..00000000 --- a/test/_completion_to_review/mkisofs.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mkisofs.exp" diff --git a/test/_completion_to_review/mknod.exp b/test/_completion_to_review/mknod.exp deleted file mode 100644 index 33a5de7a..00000000 --- a/test/_completion_to_review/mknod.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mknod.exp" diff --git a/test/_completion_to_review/mmsitepass.exp b/test/_completion_to_review/mmsitepass.exp deleted file mode 100644 index d27dd672..00000000 --- a/test/_completion_to_review/mmsitepass.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mmsitepass.exp" diff --git a/test/_completion_to_review/module.exp b/test/_completion_to_review/module.exp deleted file mode 100644 index e610b5f8..00000000 --- a/test/_completion_to_review/module.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/module.exp" diff --git a/test/_completion_to_review/mogrify.exp b/test/_completion_to_review/mogrify.exp deleted file mode 100644 index 8f26d907..00000000 --- a/test/_completion_to_review/mogrify.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mogrify.exp" diff --git a/test/_completion_to_review/montage.exp b/test/_completion_to_review/montage.exp deleted file mode 100644 index 8a97569d..00000000 --- a/test/_completion_to_review/montage.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/montage.exp" diff --git a/test/_completion_to_review/msgsnarf.exp b/test/_completion_to_review/msgsnarf.exp deleted file mode 100644 index f8056ea8..00000000 --- a/test/_completion_to_review/msgsnarf.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/msgsnarf.exp" diff --git a/test/_completion_to_review/mtx.exp b/test/_completion_to_review/mtx.exp deleted file mode 100644 index 8dbf43f2..00000000 --- a/test/_completion_to_review/mtx.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mtx.exp" diff --git a/test/_completion_to_review/mutt.exp b/test/_completion_to_review/mutt.exp deleted file mode 100644 index 29a9a75d..00000000 --- a/test/_completion_to_review/mutt.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mutt.exp" diff --git a/test/_completion_to_review/muttng.exp b/test/_completion_to_review/muttng.exp deleted file mode 100644 index d4e98ecd..00000000 --- a/test/_completion_to_review/muttng.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/muttng.exp" diff --git a/test/_completion_to_review/mv.exp b/test/_completion_to_review/mv.exp deleted file mode 100644 index 735266db..00000000 --- a/test/_completion_to_review/mv.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/mv.exp" diff --git a/test/completion/.ld.exp.swp b/test/completion/.ld.exp.swp deleted file mode 100644 index a5ba7407c0117394ce6a70fcf628794f4f5a3682..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&u}Z^G6oBDVog75b(dC+s(xlcw!O=k!9CZ;XNpqu-vSbP^xN zC()Y{R4CNVq5KC9$vyX6LcTFMLI3LPLLIsTv9T#~`WBu)ukFdxj!2a2Fq}3Ui=&(! zUfk2{dgF=lvOK-_0>8LBNyk~DO`J|<%iidF?cT=5GrBO|Pt8k0S3hKbKZFhh5SSMz zP1HMDmxIB6zw7L(?XAoC9x4bRfB*srAb&M_M^a9Q+!WFWPx|N8(6T*M3px+zgws`=Oa;T2)C{-_)v- EFWZJkBme*a diff --git a/test/completion/m4.exp b/test/completion/m4.exp new file mode 100644 index 00000000..e1af46bb --- /dev/null +++ b/test/completion/m4.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type m4]} { + source "lib/completions/m4.exp" +}; # if diff --git a/test/completion/macof.exp b/test/completion/macof.exp new file mode 100644 index 00000000..47b846f7 --- /dev/null +++ b/test/completion/macof.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type macof]} { + source "lib/completions/macof.exp" +}; # if diff --git a/test/completion/mailmanctl.exp b/test/completion/mailmanctl.exp new file mode 100644 index 00000000..4a95fcdb --- /dev/null +++ b/test/completion/mailmanctl.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mailmanctl]} { + source "lib/completions/mailmanctl.exp" +}; # if diff --git a/test/completion/mailsnarf.exp b/test/completion/mailsnarf.exp new file mode 100644 index 00000000..91dfab5e --- /dev/null +++ b/test/completion/mailsnarf.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mailsnarf]} { + source "lib/completions/mailsnarf.exp" +}; # if diff --git a/test/completion/man.exp b/test/completion/man.exp new file mode 100644 index 00000000..9b337196 --- /dev/null +++ b/test/completion/man.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type man]} { + source "lib/completions/man.exp" +}; # if diff --git a/test/completion/mc.exp b/test/completion/mc.exp new file mode 100644 index 00000000..ae833780 --- /dev/null +++ b/test/completion/mc.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mc]} { + source "lib/completions/mc.exp" +}; # if diff --git a/test/completion/mcrypt.exp b/test/completion/mcrypt.exp new file mode 100644 index 00000000..79812dc1 --- /dev/null +++ b/test/completion/mcrypt.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mcrypt]} { + source "lib/completions/mcrypt.exp" +}; # if diff --git a/test/completion/md5sum.exp b/test/completion/md5sum.exp new file mode 100644 index 00000000..415af3a1 --- /dev/null +++ b/test/completion/md5sum.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type md5sum]} { + source "lib/completions/md5sum.exp" +}; # if diff --git a/test/completion/mdecrypt.exp b/test/completion/mdecrypt.exp new file mode 100644 index 00000000..79c7868c --- /dev/null +++ b/test/completion/mdecrypt.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mdecrypt]} { + source "lib/completions/mdecrypt.exp" +}; # if diff --git a/test/completion/mencoder.exp b/test/completion/mencoder.exp new file mode 100644 index 00000000..5a2a3ddf --- /dev/null +++ b/test/completion/mencoder.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mencoder]} { + source "lib/completions/mencoder.exp" +}; # if diff --git a/test/_completion_to_review/minicom.exp b/test/completion/minicom.exp similarity index 100% rename from test/_completion_to_review/minicom.exp rename to test/completion/minicom.exp diff --git a/test/completion/mkdir.exp b/test/completion/mkdir.exp new file mode 100644 index 00000000..ada80489 --- /dev/null +++ b/test/completion/mkdir.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mkdir]} { + source "lib/completions/mkdir.exp" +}; # if diff --git a/test/completion/mkfifo.exp b/test/completion/mkfifo.exp new file mode 100644 index 00000000..22038e2d --- /dev/null +++ b/test/completion/mkfifo.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mkfifo]} { + source "lib/completions/mkfifo.exp" +}; # if diff --git a/test/completion/mkinitrd.exp b/test/completion/mkinitrd.exp new file mode 100644 index 00000000..9b55cfca --- /dev/null +++ b/test/completion/mkinitrd.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mkinitrd]} { + source "lib/completions/mkinitrd.exp" +}; # if diff --git a/test/completion/mkisofs.exp b/test/completion/mkisofs.exp new file mode 100644 index 00000000..f8303a66 --- /dev/null +++ b/test/completion/mkisofs.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {mkisofs}]} { + source "lib/completions/mkisofs.exp" +}; # if diff --git a/test/completion/mknod.exp b/test/completion/mknod.exp new file mode 100644 index 00000000..f8b803e2 --- /dev/null +++ b/test/completion/mknod.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mknod]} { + source "lib/completions/mknod.exp" +}; # if diff --git a/test/completion/mmsitepass.exp b/test/completion/mmsitepass.exp new file mode 100644 index 00000000..dc353910 --- /dev/null +++ b/test/completion/mmsitepass.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mmsitepass]} { + source "lib/completions/mmsitepass.exp" +}; # if diff --git a/test/completion/module.exp b/test/completion/module.exp new file mode 100644 index 00000000..9463f7f3 --- /dev/null +++ b/test/completion/module.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type module]} { + source "lib/completions/module.exp" +}; # if diff --git a/test/completion/mogrify.exp b/test/completion/mogrify.exp new file mode 100644 index 00000000..9f68eac9 --- /dev/null +++ b/test/completion/mogrify.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mogrify]} { + source "lib/completions/mogrify.exp" +}; # if diff --git a/test/completion/montage.exp b/test/completion/montage.exp new file mode 100644 index 00000000..cb216f26 --- /dev/null +++ b/test/completion/montage.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type montage]} { + source "lib/completions/montage.exp" +}; # if diff --git a/test/completion/mplayer.exp b/test/completion/mplayer.exp index 76975288..6d46097b 100644 --- a/test/completion/mplayer.exp +++ b/test/completion/mplayer.exp @@ -1 +1,3 @@ -source "lib/completions/mplayer.exp" +if {[assert_bash_type mplayer]} { + source "lib/completions/mplayer.exp" +}; # if diff --git a/test/completion/msgsnarf.exp b/test/completion/msgsnarf.exp new file mode 100644 index 00000000..1ba9e362 --- /dev/null +++ b/test/completion/msgsnarf.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type msgsnarf]} { + source "lib/completions/msgsnarf.exp" +}; # if diff --git a/test/completion/mtx.exp b/test/completion/mtx.exp new file mode 100644 index 00000000..3b3dd35c --- /dev/null +++ b/test/completion/mtx.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mtx]} { + source "lib/completions/mtx.exp" +}; # if diff --git a/test/completion/mutt.exp b/test/completion/mutt.exp new file mode 100644 index 00000000..6c56cf09 --- /dev/null +++ b/test/completion/mutt.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mutt]} { + source "lib/completions/mutt.exp" +}; # if diff --git a/test/completion/muttng.exp b/test/completion/muttng.exp new file mode 100644 index 00000000..0cf50732 --- /dev/null +++ b/test/completion/muttng.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type muttng]} { + source "lib/completions/muttng.exp" +}; # if diff --git a/test/completion/mv.exp b/test/completion/mv.exp new file mode 100644 index 00000000..9757600d --- /dev/null +++ b/test/completion/mv.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mv]} { + source "lib/completions/mv.exp" +}; # if diff --git a/test/completion/mysqladmin.exp b/test/completion/mysqladmin.exp new file mode 100644 index 00000000..4d7fe717 --- /dev/null +++ b/test/completion/mysqladmin.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type mysqladmin]} { + source "lib/completions/mysqladmin.exp" +}; # if diff --git a/test/lib/completions/.ld.exp.swp b/test/lib/completions/.ld.exp.swp deleted file mode 100644 index f018de376bd8556c7a4d150dd183459ad12e12ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&F;2rU6b4|Ioq~Xk#k30uwJBu)iIE8;MhaVSY6pT+C&X@{s(J)q0*-*h6_~gK zZ~-oWgv1IjXa?_V;v_nEJYmjuqgEU$8$>#rR+^)E^)#@KRmM7D;5mQqjT6eMx{Ck* zCR9KG0%HPg>sPjC*=BvCRxYjZ#f8JMWlSId0SG_<0uX=z1Rwx`=@+nZf&I`iXDCaQ zLLU0SfB*y_009U<00Izz00bZa0SG`~N(6*t?5oJw(HtF!{{K&Z1Nfxp56U~`jq*x) zp*&I^DEE{*$}Q!Fa!oOmgmOXgD1vfAN%w6~FdzT{2tWV=5P$##AOHafKmY<$C}5RH zWOS+NXr`;1uJEl&+(27;A&gOpb@O}e$`!iHOQGbYv{>18dcVED!^?cQ$?6*8H1a;B nJ8oOIA{qFBl8o-tH%FDc*XO-qd$w2JYeYx6)Hx{6RtB}dAo6hV diff --git a/test/lib/completions/find.exp b/test/lib/completions/find.exp index 63f5018d..0fb5c62c 100644 --- a/test/lib/completions/find.exp +++ b/test/lib/completions/find.exp @@ -29,17 +29,13 @@ sync_after_int set test "-wholename should complete files/dirs" - # Change directory to `fixture1' set dir fixture1 -set prompt "/$dir/@" -assert_bash_exec "cd $dir" "" $prompt - # NOTE: `-p' adds a slash to directories set files [split [exec bash -c "cd $dir && ls -p"] "\n"] -assert_complete $files "find -wholename " "" $prompt -sync_after_int $prompt -assert_bash_exec "cd \$TESTDIR" +assert_complete_dir $files "find -wholename " $dir +sync_after_int + set test "-uid should complete uids" # Complete diff --git a/test/lib/completions/m4.exp b/test/lib/completions/m4.exp new file mode 100644 index 00000000..6ed4344c --- /dev/null +++ b/test/lib/completions/m4.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "m4 --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/macof.exp b/test/lib/completions/macof.exp new file mode 100644 index 00000000..e21b1e77 --- /dev/null +++ b/test/lib/completions/macof.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "macof -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mailmanctl.exp b/test/lib/completions/mailmanctl.exp new file mode 100644 index 00000000..a69b7650 --- /dev/null +++ b/test/lib/completions/mailmanctl.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mailmanctl " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mailsnarf.exp b/test/lib/completions/mailsnarf.exp new file mode 100644 index 00000000..df9981b7 --- /dev/null +++ b/test/lib/completions/mailsnarf.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mailsnarf -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/man.exp b/test/lib/completions/man.exp new file mode 100644 index 00000000..62c14c86 --- /dev/null +++ b/test/lib/completions/man.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "man man" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mc.exp b/test/lib/completions/mc.exp new file mode 100644 index 00000000..866161ba --- /dev/null +++ b/test/lib/completions/mc.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mc -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mcrypt.exp b/test/lib/completions/mcrypt.exp new file mode 100644 index 00000000..bfc5d2d2 --- /dev/null +++ b/test/lib/completions/mcrypt.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mcrypt " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/md5sum.exp b/test/lib/completions/md5sum.exp new file mode 100644 index 00000000..25290b56 --- /dev/null +++ b/test/lib/completions/md5sum.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "md5sum " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mdecrypt.exp b/test/lib/completions/mdecrypt.exp new file mode 100644 index 00000000..4e49ae12 --- /dev/null +++ b/test/lib/completions/mdecrypt.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mdecrypt " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mencoder.exp b/test/lib/completions/mencoder.exp new file mode 100644 index 00000000..169dcb71 --- /dev/null +++ b/test/lib/completions/mencoder.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mencoder " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/minicom.exp b/test/lib/completions/minicom.exp new file mode 100644 index 00000000..935502f1 --- /dev/null +++ b/test/lib/completions/minicom.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "minicom -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mkdir.exp b/test/lib/completions/mkdir.exp new file mode 100644 index 00000000..43dfec7e --- /dev/null +++ b/test/lib/completions/mkdir.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mkdir " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mkfifo.exp b/test/lib/completions/mkfifo.exp new file mode 100644 index 00000000..c6343f8d --- /dev/null +++ b/test/lib/completions/mkfifo.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mkfifo " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mkinitrd.exp b/test/lib/completions/mkinitrd.exp new file mode 100644 index 00000000..cfb316e5 --- /dev/null +++ b/test/lib/completions/mkinitrd.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mkinitrd " + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/mkisofs.exp b/test/lib/completions/mkisofs.exp similarity index 73% rename from test/lib/completions_to_review/mkisofs.exp rename to test/lib/completions/mkisofs.exp index 6e06bd78..ad24ea06 100644 --- a/test/lib/completions_to_review/mkisofs.exp +++ b/test/lib/completions/mkisofs.exp @@ -1,23 +1,17 @@ proc setup {} { + save_env }; # setup() proc teardown {} { + assert_env_unmodified }; # teardown() setup -set test "Tab should complete" - # Try completion -set cmd "mkisofs " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +assert_complete_any "mkisofs " sync_after_int diff --git a/test/lib/completions/mknod.exp b/test/lib/completions/mknod.exp new file mode 100644 index 00000000..2c58cade --- /dev/null +++ b/test/lib/completions/mknod.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mknod " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mmsitepass.exp b/test/lib/completions/mmsitepass.exp new file mode 100644 index 00000000..d69fa202 --- /dev/null +++ b/test/lib/completions/mmsitepass.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mmsitepass " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/module.exp b/test/lib/completions/module.exp new file mode 100644 index 00000000..a34667d4 --- /dev/null +++ b/test/lib/completions/module.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "module " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mogrify.exp b/test/lib/completions/mogrify.exp new file mode 100644 index 00000000..ef7e18ee --- /dev/null +++ b/test/lib/completions/mogrify.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mogrify " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/montage.exp b/test/lib/completions/montage.exp new file mode 100644 index 00000000..736609a5 --- /dev/null +++ b/test/lib/completions/montage.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "montage " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mplayer.exp b/test/lib/completions/mplayer.exp index 88782e13..69e5d971 100644 --- a/test/lib/completions/mplayer.exp +++ b/test/lib/completions/mplayer.exp @@ -11,15 +11,7 @@ proc teardown {} { setup -set test "Tab should complete" - # Try completion -set cmd "mplayer " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +assert_complete_any "mplayer " sync_after_int diff --git a/test/lib/completions/msgsnarf.exp b/test/lib/completions/msgsnarf.exp new file mode 100644 index 00000000..74f458ff --- /dev/null +++ b/test/lib/completions/msgsnarf.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "msgsnarf -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mtx.exp b/test/lib/completions/mtx.exp new file mode 100644 index 00000000..a518d79f --- /dev/null +++ b/test/lib/completions/mtx.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mtx " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mutt.exp b/test/lib/completions/mutt.exp new file mode 100644 index 00000000..e683f471 --- /dev/null +++ b/test/lib/completions/mutt.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mutt -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/muttng.exp b/test/lib/completions/muttng.exp new file mode 100644 index 00000000..25a474ad --- /dev/null +++ b/test/lib/completions/muttng.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "muttng -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mv.exp b/test/lib/completions/mv.exp new file mode 100644 index 00000000..f2576df7 --- /dev/null +++ b/test/lib/completions/mv.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mv " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/mysqladmin.exp b/test/lib/completions/mysqladmin.exp new file mode 100644 index 00000000..76381587 --- /dev/null +++ b/test/lib/completions/mysqladmin.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mysqladmin -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/m4.exp b/test/lib/completions_to_review/m4.exp deleted file mode 100644 index daad9a1c..00000000 --- a/test/lib/completions_to_review/m4.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "m4 " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/macof.exp b/test/lib/completions_to_review/macof.exp deleted file mode 100644 index 970cae5f..00000000 --- a/test/lib/completions_to_review/macof.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "macof -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mailmanctl.exp b/test/lib/completions_to_review/mailmanctl.exp deleted file mode 100644 index 1f5df516..00000000 --- a/test/lib/completions_to_review/mailmanctl.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mailmanctl " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mailsnarf.exp b/test/lib/completions_to_review/mailsnarf.exp deleted file mode 100644 index 16009a0b..00000000 --- a/test/lib/completions_to_review/mailsnarf.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mailsnarf -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/man.exp b/test/lib/completions_to_review/man.exp deleted file mode 100644 index 1124c375..00000000 --- a/test/lib/completions_to_review/man.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should show completions" - # Try completion -set cmd "man man" -send "$cmd\t" -expect { - -re "$cmd\r\n.*/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mc.exp b/test/lib/completions_to_review/mc.exp deleted file mode 100644 index a288d7d4..00000000 --- a/test/lib/completions_to_review/mc.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mc " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mcrypt.exp b/test/lib/completions_to_review/mcrypt.exp deleted file mode 100644 index 0235d9ed..00000000 --- a/test/lib/completions_to_review/mcrypt.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mcrypt " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/md5sum.exp b/test/lib/completions_to_review/md5sum.exp deleted file mode 100644 index c44149e8..00000000 --- a/test/lib/completions_to_review/md5sum.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "md5sum " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mdecrypt.exp b/test/lib/completions_to_review/mdecrypt.exp deleted file mode 100644 index 1e53ade0..00000000 --- a/test/lib/completions_to_review/mdecrypt.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mdecrypt " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mencoder.exp b/test/lib/completions_to_review/mencoder.exp deleted file mode 100644 index c98d6cc7..00000000 --- a/test/lib/completions_to_review/mencoder.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mencoder " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/minicom.exp b/test/lib/completions_to_review/minicom.exp deleted file mode 100644 index 5ba9b123..00000000 --- a/test/lib/completions_to_review/minicom.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "minicom -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mkdir.exp b/test/lib/completions_to_review/mkdir.exp deleted file mode 100644 index a7335855..00000000 --- a/test/lib/completions_to_review/mkdir.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mkdir " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mkfifo.exp b/test/lib/completions_to_review/mkfifo.exp deleted file mode 100644 index 4a34ef06..00000000 --- a/test/lib/completions_to_review/mkfifo.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mkfifo " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mkinitrd.exp b/test/lib/completions_to_review/mkinitrd.exp deleted file mode 100644 index f69c259a..00000000 --- a/test/lib/completions_to_review/mkinitrd.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mkinitrd " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mknod.exp b/test/lib/completions_to_review/mknod.exp deleted file mode 100644 index b26f73a2..00000000 --- a/test/lib/completions_to_review/mknod.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mknod " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mmsitepass.exp b/test/lib/completions_to_review/mmsitepass.exp deleted file mode 100644 index 88ec1037..00000000 --- a/test/lib/completions_to_review/mmsitepass.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mmsitepass -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/module.exp b/test/lib/completions_to_review/module.exp deleted file mode 100644 index deb3fa32..00000000 --- a/test/lib/completions_to_review/module.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "module " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mogrify.exp b/test/lib/completions_to_review/mogrify.exp deleted file mode 100644 index c89a8821..00000000 --- a/test/lib/completions_to_review/mogrify.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mogrify " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/montage.exp b/test/lib/completions_to_review/montage.exp deleted file mode 100644 index fd1a719c..00000000 --- a/test/lib/completions_to_review/montage.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "montage " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/msgsnarf.exp b/test/lib/completions_to_review/msgsnarf.exp deleted file mode 100644 index 8ebdb369..00000000 --- a/test/lib/completions_to_review/msgsnarf.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "msgsnarf -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mtx.exp b/test/lib/completions_to_review/mtx.exp deleted file mode 100644 index 097fde00..00000000 --- a/test/lib/completions_to_review/mtx.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mtx " -send "$cmd\t" -expect { - -re "^${cmd}(bash: mtx: command not found\r\n)*\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mutt.exp b/test/lib/completions_to_review/mutt.exp deleted file mode 100644 index 0be3d676..00000000 --- a/test/lib/completions_to_review/mutt.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mutt -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/muttng.exp b/test/lib/completions_to_review/muttng.exp deleted file mode 100644 index 979148b4..00000000 --- a/test/lib/completions_to_review/muttng.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "muttng -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mv.exp b/test/lib/completions_to_review/mv.exp deleted file mode 100644 index d4db5e02..00000000 --- a/test/lib/completions_to_review/mv.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mv " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/mysqladmin.exp b/test/lib/completions_to_review/mysqladmin.exp deleted file mode 100644 index 113edf3a..00000000 --- a/test/lib/completions_to_review/mysqladmin.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "mysqladmin -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From 890cadbc3ab435109bb7fb2cb1c0adbd20da1482 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 24 Jul 2009 11:16:03 +0200 Subject: [PATCH 23/69] Reviewed tests n* --- test/_completion_to_review/ncftp.exp | 1 - test/_completion_to_review/netstat.exp | 1 - test/_completion_to_review/newlist.exp | 1 - test/_completion_to_review/nl.exp | 1 - test/_completion_to_review/nm.exp | 1 - test/completion/ncftp.exp | 3 +++ test/completion/netstat.exp | 3 +++ test/completion/newlist.exp | 3 +++ test/completion/nl.exp | 3 +++ test/completion/nm.exp | 3 +++ .../ntpdate.exp | 0 test/lib/completions/ncftp.exp | 20 ++++++++++++++ test/lib/completions/netstat.exp | 20 ++++++++++++++ test/lib/completions/newlist.exp | 20 ++++++++++++++ test/lib/completions/nl.exp | 20 ++++++++++++++ test/lib/completions/nm.exp | 20 ++++++++++++++ test/lib/completions/ntpdate.exp | 20 ++++++++++++++ test/lib/completions_to_review/ncftp.exp | 26 ------------------- test/lib/completions_to_review/netstat.exp | 26 ------------------- test/lib/completions_to_review/newlist.exp | 26 ------------------- test/lib/completions_to_review/nl.exp | 26 ------------------- test/lib/completions_to_review/nm.exp | 26 ------------------- test/lib/completions_to_review/ntpdate.exp | 26 ------------------- 23 files changed, 135 insertions(+), 161 deletions(-) delete mode 100644 test/_completion_to_review/ncftp.exp delete mode 100644 test/_completion_to_review/netstat.exp delete mode 100644 test/_completion_to_review/newlist.exp delete mode 100644 test/_completion_to_review/nl.exp delete mode 100644 test/_completion_to_review/nm.exp create mode 100644 test/completion/ncftp.exp create mode 100644 test/completion/netstat.exp create mode 100644 test/completion/newlist.exp create mode 100644 test/completion/nl.exp create mode 100644 test/completion/nm.exp rename test/{_completion_to_review => completion}/ntpdate.exp (100%) create mode 100644 test/lib/completions/ncftp.exp create mode 100644 test/lib/completions/netstat.exp create mode 100644 test/lib/completions/newlist.exp create mode 100644 test/lib/completions/nl.exp create mode 100644 test/lib/completions/nm.exp create mode 100644 test/lib/completions/ntpdate.exp delete mode 100644 test/lib/completions_to_review/ncftp.exp delete mode 100644 test/lib/completions_to_review/netstat.exp delete mode 100644 test/lib/completions_to_review/newlist.exp delete mode 100644 test/lib/completions_to_review/nl.exp delete mode 100644 test/lib/completions_to_review/nm.exp delete mode 100644 test/lib/completions_to_review/ntpdate.exp diff --git a/test/_completion_to_review/ncftp.exp b/test/_completion_to_review/ncftp.exp deleted file mode 100644 index 12c5e7dc..00000000 --- a/test/_completion_to_review/ncftp.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ncftp.exp" diff --git a/test/_completion_to_review/netstat.exp b/test/_completion_to_review/netstat.exp deleted file mode 100644 index e9893b04..00000000 --- a/test/_completion_to_review/netstat.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/netstat.exp" diff --git a/test/_completion_to_review/newlist.exp b/test/_completion_to_review/newlist.exp deleted file mode 100644 index 80bee0cd..00000000 --- a/test/_completion_to_review/newlist.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/newlist.exp" diff --git a/test/_completion_to_review/nl.exp b/test/_completion_to_review/nl.exp deleted file mode 100644 index 3d4eea2d..00000000 --- a/test/_completion_to_review/nl.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/nl.exp" diff --git a/test/_completion_to_review/nm.exp b/test/_completion_to_review/nm.exp deleted file mode 100644 index 1238ac07..00000000 --- a/test/_completion_to_review/nm.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/nm.exp" diff --git a/test/completion/ncftp.exp b/test/completion/ncftp.exp new file mode 100644 index 00000000..3e3fe2df --- /dev/null +++ b/test/completion/ncftp.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type ncftp]} { + source "lib/completions/ncftp.exp" +}; # if diff --git a/test/completion/netstat.exp b/test/completion/netstat.exp new file mode 100644 index 00000000..a3084f16 --- /dev/null +++ b/test/completion/netstat.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type netstat]} { + source "lib/completions/netstat.exp" +}; # if diff --git a/test/completion/newlist.exp b/test/completion/newlist.exp new file mode 100644 index 00000000..dcc9d092 --- /dev/null +++ b/test/completion/newlist.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type newlist]} { + source "lib/completions/newlist.exp" +}; # if diff --git a/test/completion/nl.exp b/test/completion/nl.exp new file mode 100644 index 00000000..a64021b6 --- /dev/null +++ b/test/completion/nl.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type nl]} { + source "lib/completions/nl.exp" +}; # if diff --git a/test/completion/nm.exp b/test/completion/nm.exp new file mode 100644 index 00000000..48e8430b --- /dev/null +++ b/test/completion/nm.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type nm]} { + source "lib/completions/nm.exp" +}; # if diff --git a/test/_completion_to_review/ntpdate.exp b/test/completion/ntpdate.exp similarity index 100% rename from test/_completion_to_review/ntpdate.exp rename to test/completion/ntpdate.exp diff --git a/test/lib/completions/ncftp.exp b/test/lib/completions/ncftp.exp new file mode 100644 index 00000000..ad71f226 --- /dev/null +++ b/test/lib/completions/ncftp.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ncftp " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/netstat.exp b/test/lib/completions/netstat.exp new file mode 100644 index 00000000..0e6414d6 --- /dev/null +++ b/test/lib/completions/netstat.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "netstat " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/newlist.exp b/test/lib/completions/newlist.exp new file mode 100644 index 00000000..bebf600d --- /dev/null +++ b/test/lib/completions/newlist.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "newlist " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/nl.exp b/test/lib/completions/nl.exp new file mode 100644 index 00000000..02076dff --- /dev/null +++ b/test/lib/completions/nl.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "nl " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/nm.exp b/test/lib/completions/nm.exp new file mode 100644 index 00000000..551f49e9 --- /dev/null +++ b/test/lib/completions/nm.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "nm " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ntpdate.exp b/test/lib/completions/ntpdate.exp new file mode 100644 index 00000000..6a6456f4 --- /dev/null +++ b/test/lib/completions/ntpdate.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ntpdate -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/ncftp.exp b/test/lib/completions_to_review/ncftp.exp deleted file mode 100644 index 553b9caa..00000000 --- a/test/lib/completions_to_review/ncftp.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ncftp " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/netstat.exp b/test/lib/completions_to_review/netstat.exp deleted file mode 100644 index 7c34419d..00000000 --- a/test/lib/completions_to_review/netstat.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "netstat " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/newlist.exp b/test/lib/completions_to_review/newlist.exp deleted file mode 100644 index 93273c7b..00000000 --- a/test/lib/completions_to_review/newlist.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "newlist -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/nl.exp b/test/lib/completions_to_review/nl.exp deleted file mode 100644 index 7c0071dc..00000000 --- a/test/lib/completions_to_review/nl.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "nl " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/nm.exp b/test/lib/completions_to_review/nm.exp deleted file mode 100644 index 9e61b41c..00000000 --- a/test/lib/completions_to_review/nm.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "nm " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ntpdate.exp b/test/lib/completions_to_review/ntpdate.exp deleted file mode 100644 index 2c968088..00000000 --- a/test/lib/completions_to_review/ntpdate.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ntpdate -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From 285136a8dfb6c83652efe2f4c541c2f0866766c2 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 24 Jul 2009 11:20:38 +0200 Subject: [PATCH 24/69] Reviewed tests o* --- test/_completion_to_review/objcopy.exp | 1 - test/_completion_to_review/objdump.exp | 1 - test/_completion_to_review/od.exp | 1 - test/completion/objcopy.exp | 3 +++ test/completion/objdump.exp | 3 +++ test/completion/od.exp | 3 +++ test/lib/completions/objcopy.exp | 20 ++++++++++++++ test/lib/completions/objdump.exp | 20 ++++++++++++++ test/lib/completions/od.exp | 20 ++++++++++++++ .../openssl.exp | 0 test/lib/completions_to_review/objcopy.exp | 26 ------------------- test/lib/completions_to_review/objdump.exp | 26 ------------------- test/lib/completions_to_review/od.exp | 26 ------------------- 13 files changed, 69 insertions(+), 81 deletions(-) delete mode 100644 test/_completion_to_review/objcopy.exp delete mode 100644 test/_completion_to_review/objdump.exp delete mode 100644 test/_completion_to_review/od.exp create mode 100644 test/completion/objcopy.exp create mode 100644 test/completion/objdump.exp create mode 100644 test/completion/od.exp create mode 100644 test/lib/completions/objcopy.exp create mode 100644 test/lib/completions/objdump.exp create mode 100644 test/lib/completions/od.exp rename test/lib/{completions_to_review => completions}/openssl.exp (100%) delete mode 100644 test/lib/completions_to_review/objcopy.exp delete mode 100644 test/lib/completions_to_review/objdump.exp delete mode 100644 test/lib/completions_to_review/od.exp diff --git a/test/_completion_to_review/objcopy.exp b/test/_completion_to_review/objcopy.exp deleted file mode 100644 index ce7d043a..00000000 --- a/test/_completion_to_review/objcopy.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/objcopy.exp" diff --git a/test/_completion_to_review/objdump.exp b/test/_completion_to_review/objdump.exp deleted file mode 100644 index 548b4115..00000000 --- a/test/_completion_to_review/objdump.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/objdump.exp" diff --git a/test/_completion_to_review/od.exp b/test/_completion_to_review/od.exp deleted file mode 100644 index 51187cae..00000000 --- a/test/_completion_to_review/od.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/od.exp" diff --git a/test/completion/objcopy.exp b/test/completion/objcopy.exp new file mode 100644 index 00000000..1bfda5a7 --- /dev/null +++ b/test/completion/objcopy.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type objcopy]} { + source "lib/completions/objcopy.exp" +}; # if diff --git a/test/completion/objdump.exp b/test/completion/objdump.exp new file mode 100644 index 00000000..b617b158 --- /dev/null +++ b/test/completion/objdump.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type objdump]} { + source "lib/completions/objdump.exp" +}; # if diff --git a/test/completion/od.exp b/test/completion/od.exp new file mode 100644 index 00000000..cb854117 --- /dev/null +++ b/test/completion/od.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type od]} { + source "lib/completions/od.exp" +}; # if diff --git a/test/lib/completions/objcopy.exp b/test/lib/completions/objcopy.exp new file mode 100644 index 00000000..acb6539a --- /dev/null +++ b/test/lib/completions/objcopy.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "objcopy " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/objdump.exp b/test/lib/completions/objdump.exp new file mode 100644 index 00000000..5eec35d6 --- /dev/null +++ b/test/lib/completions/objdump.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "objdump " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/od.exp b/test/lib/completions/od.exp new file mode 100644 index 00000000..5838218c --- /dev/null +++ b/test/lib/completions/od.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "od " + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/openssl.exp b/test/lib/completions/openssl.exp similarity index 100% rename from test/lib/completions_to_review/openssl.exp rename to test/lib/completions/openssl.exp diff --git a/test/lib/completions_to_review/objcopy.exp b/test/lib/completions_to_review/objcopy.exp deleted file mode 100644 index 733785c5..00000000 --- a/test/lib/completions_to_review/objcopy.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "objcopy " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/objdump.exp b/test/lib/completions_to_review/objdump.exp deleted file mode 100644 index faba38ca..00000000 --- a/test/lib/completions_to_review/objdump.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "objdump " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/od.exp b/test/lib/completions_to_review/od.exp deleted file mode 100644 index f1171405..00000000 --- a/test/lib/completions_to_review/od.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "od " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From 3d7321bc6891c01a29ad058e1ef6e72ab5242ccc Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 24 Jul 2009 11:52:58 +0200 Subject: [PATCH 25/69] Fix leaking $i from python completion --- CHANGES | 2 +- contrib/python | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index af990319..4bee8414 100644 --- a/CHANGES +++ b/CHANGES @@ -139,7 +139,7 @@ bash-completion (1.x) [ Freddy Vulto ] * Patched _known_hosts() to support multiple {Global,User}KnownHosts in SSH config files, thanks to Thomas Nilsson (Alioth: #311595) (Debian: #524190) - * Fix leaking $i from info and man completions. + * Fix leaking $i from info, man and python completions. -- David Paleino Thu, 18 Jun 2009 13:12:36 +0200 diff --git a/contrib/python b/contrib/python index ffb55a48..1a841966 100644 --- a/contrib/python +++ b/contrib/python @@ -6,7 +6,7 @@ have python && _python() { - local prev cur + local prev cur i COMPREPLY=() cur=`_get_cword` From 53b1c41c160c3b112cbf6491f5c8840edd289e18 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 24 Jul 2009 11:58:02 +0200 Subject: [PATCH 26/69] Reviewed tests p* --- test/_completion_to_review/p4.exp | 1 - test/_completion_to_review/paste.exp | 1 - test/_completion_to_review/patch.exp | 1 - test/_completion_to_review/perl.exp | 1 - test/_completion_to_review/perldoc.exp | 1 - test/_completion_to_review/pine.exp | 1 - test/_completion_to_review/pkg_deinstall.exp | 1 - test/_completion_to_review/pkg_delete.exp | 1 - test/_completion_to_review/pkg_info.exp | 1 - test/_completion_to_review/portinstall.exp | 1 - test/_completion_to_review/portupgrade.exp | 1 - test/_completion_to_review/povray.exp | 1 - test/_completion_to_review/pr.exp | 1 - test/_completion_to_review/psql.exp | 1 - test/_completion_to_review/ptx.exp | 1 - test/_completion_to_review/python.exp | 1 - test/completion/p4.exp | 3 ++ test/completion/paste.exp | 3 ++ test/completion/patch.exp | 3 ++ test/completion/perl.exp | 3 ++ test/completion/perldoc.exp | 3 ++ test/completion/pine.exp | 3 ++ .../pkg-config.exp | 0 test/completion/pkg_deinstall.exp | 3 ++ test/completion/pkg_delete.exp | 3 ++ test/completion/pkg_info.exp | 3 ++ test/completion/portinstall.exp | 3 ++ test/completion/portupgrade.exp | 3 ++ test/completion/povray.exp | 3 ++ test/completion/pr.exp | 3 ++ test/completion/psql.exp | 3 ++ test/completion/ptx.exp | 3 ++ .../pvchange.exp | 0 .../pvcreate.exp | 0 .../pvdisplay.exp | 0 .../pvmove.exp | 0 .../pvremove.exp | 0 .../pvs.exp | 0 .../pvscan.exp | 0 test/completion/python.exp | 3 ++ test/lib/completions/p4.exp | 20 +++++++++++++ test/lib/completions/paste.exp | 20 +++++++++++++ test/lib/completions/patch.exp | 20 +++++++++++++ .../perl.exp | 28 ++++++------------- test/lib/completions/perldoc.exp | 20 +++++++++++++ test/lib/completions/pine.exp | 20 +++++++++++++ test/lib/completions/pkg-config.exp | 20 +++++++++++++ test/lib/completions/pkg_deinstall.exp | 20 +++++++++++++ test/lib/completions/pkg_delete.exp | 20 +++++++++++++ test/lib/completions/pkg_info.exp | 20 +++++++++++++ test/lib/completions/portinstall.exp | 20 +++++++++++++ test/lib/completions/portupgrade.exp | 20 +++++++++++++ test/lib/completions/povray.exp | 20 +++++++++++++ test/lib/completions/pr.exp | 20 +++++++++++++ test/lib/completions/psql.exp | 20 +++++++++++++ test/lib/completions/ptx.exp | 20 +++++++++++++ test/lib/completions/pvchange.exp | 20 +++++++++++++ test/lib/completions/pvcreate.exp | 20 +++++++++++++ test/lib/completions/pvdisplay.exp | 20 +++++++++++++ test/lib/completions/pvmove.exp | 20 +++++++++++++ test/lib/completions/pvremove.exp | 20 +++++++++++++ test/lib/completions/pvs.exp | 20 +++++++++++++ test/lib/completions/pvscan.exp | 20 +++++++++++++ test/lib/completions/python.exp | 20 +++++++++++++ test/lib/completions_to_review/p4.exp | 26 ----------------- test/lib/completions_to_review/paste.exp | 26 ----------------- test/lib/completions_to_review/patch.exp | 26 ----------------- test/lib/completions_to_review/perldoc.exp | 26 ----------------- test/lib/completions_to_review/pine.exp | 26 ----------------- test/lib/completions_to_review/pkg-config.exp | 26 ----------------- .../completions_to_review/pkg_deinstall.exp | 26 ----------------- test/lib/completions_to_review/pkg_delete.exp | 26 ----------------- test/lib/completions_to_review/pkg_info.exp | 26 ----------------- .../lib/completions_to_review/portinstall.exp | 26 ----------------- .../lib/completions_to_review/portupgrade.exp | 26 ----------------- test/lib/completions_to_review/povray.exp | 26 ----------------- test/lib/completions_to_review/pr.exp | 26 ----------------- test/lib/completions_to_review/psql.exp | 26 ----------------- test/lib/completions_to_review/ptx.exp | 26 ----------------- test/lib/completions_to_review/pvchange.exp | 26 ----------------- test/lib/completions_to_review/pvcreate.exp | 26 ----------------- test/lib/completions_to_review/pvdisplay.exp | 26 ----------------- test/lib/completions_to_review/pvmove.exp | 26 ----------------- test/lib/completions_to_review/pvremove.exp | 26 ----------------- test/lib/completions_to_review/pvs.exp | 26 ----------------- test/lib/completions_to_review/pvscan.exp | 26 ----------------- test/lib/completions_to_review/python.exp | 26 ----------------- 87 files changed, 517 insertions(+), 633 deletions(-) delete mode 100644 test/_completion_to_review/p4.exp delete mode 100644 test/_completion_to_review/paste.exp delete mode 100644 test/_completion_to_review/patch.exp delete mode 100644 test/_completion_to_review/perl.exp delete mode 100644 test/_completion_to_review/perldoc.exp delete mode 100644 test/_completion_to_review/pine.exp delete mode 100644 test/_completion_to_review/pkg_deinstall.exp delete mode 100644 test/_completion_to_review/pkg_delete.exp delete mode 100644 test/_completion_to_review/pkg_info.exp delete mode 100644 test/_completion_to_review/portinstall.exp delete mode 100644 test/_completion_to_review/portupgrade.exp delete mode 100644 test/_completion_to_review/povray.exp delete mode 100644 test/_completion_to_review/pr.exp delete mode 100644 test/_completion_to_review/psql.exp delete mode 100644 test/_completion_to_review/ptx.exp delete mode 100644 test/_completion_to_review/python.exp create mode 100644 test/completion/p4.exp create mode 100644 test/completion/paste.exp create mode 100644 test/completion/patch.exp create mode 100644 test/completion/perl.exp create mode 100644 test/completion/perldoc.exp create mode 100644 test/completion/pine.exp rename test/{_completion_to_review => completion}/pkg-config.exp (100%) create mode 100644 test/completion/pkg_deinstall.exp create mode 100644 test/completion/pkg_delete.exp create mode 100644 test/completion/pkg_info.exp create mode 100644 test/completion/portinstall.exp create mode 100644 test/completion/portupgrade.exp create mode 100644 test/completion/povray.exp create mode 100644 test/completion/pr.exp create mode 100644 test/completion/psql.exp create mode 100644 test/completion/ptx.exp rename test/{_completion_to_review => completion}/pvchange.exp (100%) rename test/{_completion_to_review => completion}/pvcreate.exp (100%) rename test/{_completion_to_review => completion}/pvdisplay.exp (100%) rename test/{_completion_to_review => completion}/pvmove.exp (100%) rename test/{_completion_to_review => completion}/pvremove.exp (100%) rename test/{_completion_to_review => completion}/pvs.exp (100%) rename test/{_completion_to_review => completion}/pvscan.exp (100%) create mode 100644 test/completion/python.exp create mode 100644 test/lib/completions/p4.exp create mode 100644 test/lib/completions/paste.exp create mode 100644 test/lib/completions/patch.exp rename test/lib/{completions_to_review => completions}/perl.exp (64%) create mode 100644 test/lib/completions/perldoc.exp create mode 100644 test/lib/completions/pine.exp create mode 100644 test/lib/completions/pkg-config.exp create mode 100644 test/lib/completions/pkg_deinstall.exp create mode 100644 test/lib/completions/pkg_delete.exp create mode 100644 test/lib/completions/pkg_info.exp create mode 100644 test/lib/completions/portinstall.exp create mode 100644 test/lib/completions/portupgrade.exp create mode 100644 test/lib/completions/povray.exp create mode 100644 test/lib/completions/pr.exp create mode 100644 test/lib/completions/psql.exp create mode 100644 test/lib/completions/ptx.exp create mode 100644 test/lib/completions/pvchange.exp create mode 100644 test/lib/completions/pvcreate.exp create mode 100644 test/lib/completions/pvdisplay.exp create mode 100644 test/lib/completions/pvmove.exp create mode 100644 test/lib/completions/pvremove.exp create mode 100644 test/lib/completions/pvs.exp create mode 100644 test/lib/completions/pvscan.exp create mode 100644 test/lib/completions/python.exp delete mode 100644 test/lib/completions_to_review/p4.exp delete mode 100644 test/lib/completions_to_review/paste.exp delete mode 100644 test/lib/completions_to_review/patch.exp delete mode 100644 test/lib/completions_to_review/perldoc.exp delete mode 100644 test/lib/completions_to_review/pine.exp delete mode 100644 test/lib/completions_to_review/pkg-config.exp delete mode 100644 test/lib/completions_to_review/pkg_deinstall.exp delete mode 100644 test/lib/completions_to_review/pkg_delete.exp delete mode 100644 test/lib/completions_to_review/pkg_info.exp delete mode 100644 test/lib/completions_to_review/portinstall.exp delete mode 100644 test/lib/completions_to_review/portupgrade.exp delete mode 100644 test/lib/completions_to_review/povray.exp delete mode 100644 test/lib/completions_to_review/pr.exp delete mode 100644 test/lib/completions_to_review/psql.exp delete mode 100644 test/lib/completions_to_review/ptx.exp delete mode 100644 test/lib/completions_to_review/pvchange.exp delete mode 100644 test/lib/completions_to_review/pvcreate.exp delete mode 100644 test/lib/completions_to_review/pvdisplay.exp delete mode 100644 test/lib/completions_to_review/pvmove.exp delete mode 100644 test/lib/completions_to_review/pvremove.exp delete mode 100644 test/lib/completions_to_review/pvs.exp delete mode 100644 test/lib/completions_to_review/pvscan.exp delete mode 100644 test/lib/completions_to_review/python.exp diff --git a/test/_completion_to_review/p4.exp b/test/_completion_to_review/p4.exp deleted file mode 100644 index 7de48de3..00000000 --- a/test/_completion_to_review/p4.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/p4.exp" diff --git a/test/_completion_to_review/paste.exp b/test/_completion_to_review/paste.exp deleted file mode 100644 index 017e25f6..00000000 --- a/test/_completion_to_review/paste.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/paste.exp" diff --git a/test/_completion_to_review/patch.exp b/test/_completion_to_review/patch.exp deleted file mode 100644 index 69a49701..00000000 --- a/test/_completion_to_review/patch.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/patch.exp" diff --git a/test/_completion_to_review/perl.exp b/test/_completion_to_review/perl.exp deleted file mode 100644 index a7817b3c..00000000 --- a/test/_completion_to_review/perl.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/perl.exp" diff --git a/test/_completion_to_review/perldoc.exp b/test/_completion_to_review/perldoc.exp deleted file mode 100644 index 526e1440..00000000 --- a/test/_completion_to_review/perldoc.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/perldoc.exp" diff --git a/test/_completion_to_review/pine.exp b/test/_completion_to_review/pine.exp deleted file mode 100644 index 414bd3ac..00000000 --- a/test/_completion_to_review/pine.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/pine.exp" diff --git a/test/_completion_to_review/pkg_deinstall.exp b/test/_completion_to_review/pkg_deinstall.exp deleted file mode 100644 index bc721beb..00000000 --- a/test/_completion_to_review/pkg_deinstall.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/pkg_deinstall.exp" diff --git a/test/_completion_to_review/pkg_delete.exp b/test/_completion_to_review/pkg_delete.exp deleted file mode 100644 index e43d50e3..00000000 --- a/test/_completion_to_review/pkg_delete.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/pkg_delete.exp" diff --git a/test/_completion_to_review/pkg_info.exp b/test/_completion_to_review/pkg_info.exp deleted file mode 100644 index 54cd1b7b..00000000 --- a/test/_completion_to_review/pkg_info.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/pkg_info.exp" diff --git a/test/_completion_to_review/portinstall.exp b/test/_completion_to_review/portinstall.exp deleted file mode 100644 index fd223e5c..00000000 --- a/test/_completion_to_review/portinstall.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/portinstall.exp" diff --git a/test/_completion_to_review/portupgrade.exp b/test/_completion_to_review/portupgrade.exp deleted file mode 100644 index 22e50cfa..00000000 --- a/test/_completion_to_review/portupgrade.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/portupgrade.exp" diff --git a/test/_completion_to_review/povray.exp b/test/_completion_to_review/povray.exp deleted file mode 100644 index bf7688a3..00000000 --- a/test/_completion_to_review/povray.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/povray.exp" diff --git a/test/_completion_to_review/pr.exp b/test/_completion_to_review/pr.exp deleted file mode 100644 index 3f08a619..00000000 --- a/test/_completion_to_review/pr.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/pr.exp" diff --git a/test/_completion_to_review/psql.exp b/test/_completion_to_review/psql.exp deleted file mode 100644 index 0fcc8c8f..00000000 --- a/test/_completion_to_review/psql.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/psql.exp" diff --git a/test/_completion_to_review/ptx.exp b/test/_completion_to_review/ptx.exp deleted file mode 100644 index 000594f5..00000000 --- a/test/_completion_to_review/ptx.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ptx.exp" diff --git a/test/_completion_to_review/python.exp b/test/_completion_to_review/python.exp deleted file mode 100644 index 18cee883..00000000 --- a/test/_completion_to_review/python.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/python.exp" diff --git a/test/completion/p4.exp b/test/completion/p4.exp new file mode 100644 index 00000000..d261ee09 --- /dev/null +++ b/test/completion/p4.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type p4]} { + source "lib/completions/p4.exp" +}; # if diff --git a/test/completion/paste.exp b/test/completion/paste.exp new file mode 100644 index 00000000..3358b9f3 --- /dev/null +++ b/test/completion/paste.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type paste]} { + source "lib/completions/paste.exp" +}; # if diff --git a/test/completion/patch.exp b/test/completion/patch.exp new file mode 100644 index 00000000..a8b9b76e --- /dev/null +++ b/test/completion/patch.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type patch]} { + source "lib/completions/patch.exp" +}; # if diff --git a/test/completion/perl.exp b/test/completion/perl.exp new file mode 100644 index 00000000..496d4db1 --- /dev/null +++ b/test/completion/perl.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {perl}]} { + source "lib/completions/perl.exp" +}; # if diff --git a/test/completion/perldoc.exp b/test/completion/perldoc.exp new file mode 100644 index 00000000..31162522 --- /dev/null +++ b/test/completion/perldoc.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type perldoc]} { + source "lib/completions/perldoc.exp" +}; # if diff --git a/test/completion/pine.exp b/test/completion/pine.exp new file mode 100644 index 00000000..108b0ccc --- /dev/null +++ b/test/completion/pine.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type pine]} { + source "lib/completions/pine.exp" +}; # if diff --git a/test/_completion_to_review/pkg-config.exp b/test/completion/pkg-config.exp similarity index 100% rename from test/_completion_to_review/pkg-config.exp rename to test/completion/pkg-config.exp diff --git a/test/completion/pkg_deinstall.exp b/test/completion/pkg_deinstall.exp new file mode 100644 index 00000000..67b0a7e2 --- /dev/null +++ b/test/completion/pkg_deinstall.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type pkg_deinstall]} { + source "lib/completions/pkg_deinstall.exp" +}; # if diff --git a/test/completion/pkg_delete.exp b/test/completion/pkg_delete.exp new file mode 100644 index 00000000..d90eca2c --- /dev/null +++ b/test/completion/pkg_delete.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type pkg_delete]} { + source "lib/completions/pkg_delete.exp" +}; # if diff --git a/test/completion/pkg_info.exp b/test/completion/pkg_info.exp new file mode 100644 index 00000000..1a7fe000 --- /dev/null +++ b/test/completion/pkg_info.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type pkg_info]} { + source "lib/completions/pkg_info.exp" +}; # if diff --git a/test/completion/portinstall.exp b/test/completion/portinstall.exp new file mode 100644 index 00000000..fa6fc8b7 --- /dev/null +++ b/test/completion/portinstall.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type portinstall]} { + source "lib/completions/portinstall.exp" +}; # if diff --git a/test/completion/portupgrade.exp b/test/completion/portupgrade.exp new file mode 100644 index 00000000..bc2e8576 --- /dev/null +++ b/test/completion/portupgrade.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type portupgrade]} { + source "lib/completions/portupgrade.exp" +}; # if diff --git a/test/completion/povray.exp b/test/completion/povray.exp new file mode 100644 index 00000000..0c50f4fd --- /dev/null +++ b/test/completion/povray.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type povray]} { + source "lib/completions/povray.exp" +}; # if diff --git a/test/completion/pr.exp b/test/completion/pr.exp new file mode 100644 index 00000000..de0884ad --- /dev/null +++ b/test/completion/pr.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type pr]} { + source "lib/completions/pr.exp" +}; # if diff --git a/test/completion/psql.exp b/test/completion/psql.exp new file mode 100644 index 00000000..86a3f297 --- /dev/null +++ b/test/completion/psql.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type psql]} { + source "lib/completions/psql.exp" +}; # if diff --git a/test/completion/ptx.exp b/test/completion/ptx.exp new file mode 100644 index 00000000..75656a96 --- /dev/null +++ b/test/completion/ptx.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type ptx]} { + source "lib/completions/ptx.exp" +}; # if diff --git a/test/_completion_to_review/pvchange.exp b/test/completion/pvchange.exp similarity index 100% rename from test/_completion_to_review/pvchange.exp rename to test/completion/pvchange.exp diff --git a/test/_completion_to_review/pvcreate.exp b/test/completion/pvcreate.exp similarity index 100% rename from test/_completion_to_review/pvcreate.exp rename to test/completion/pvcreate.exp diff --git a/test/_completion_to_review/pvdisplay.exp b/test/completion/pvdisplay.exp similarity index 100% rename from test/_completion_to_review/pvdisplay.exp rename to test/completion/pvdisplay.exp diff --git a/test/_completion_to_review/pvmove.exp b/test/completion/pvmove.exp similarity index 100% rename from test/_completion_to_review/pvmove.exp rename to test/completion/pvmove.exp diff --git a/test/_completion_to_review/pvremove.exp b/test/completion/pvremove.exp similarity index 100% rename from test/_completion_to_review/pvremove.exp rename to test/completion/pvremove.exp diff --git a/test/_completion_to_review/pvs.exp b/test/completion/pvs.exp similarity index 100% rename from test/_completion_to_review/pvs.exp rename to test/completion/pvs.exp diff --git a/test/_completion_to_review/pvscan.exp b/test/completion/pvscan.exp similarity index 100% rename from test/_completion_to_review/pvscan.exp rename to test/completion/pvscan.exp diff --git a/test/completion/python.exp b/test/completion/python.exp new file mode 100644 index 00000000..fd44bfbe --- /dev/null +++ b/test/completion/python.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type python]} { + source "lib/completions/python.exp" +}; # if diff --git a/test/lib/completions/p4.exp b/test/lib/completions/p4.exp new file mode 100644 index 00000000..369d2c6b --- /dev/null +++ b/test/lib/completions/p4.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "p4 " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/paste.exp b/test/lib/completions/paste.exp new file mode 100644 index 00000000..3a4e93be --- /dev/null +++ b/test/lib/completions/paste.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "paste " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/patch.exp b/test/lib/completions/patch.exp new file mode 100644 index 00000000..a44fa130 --- /dev/null +++ b/test/lib/completions/patch.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "patch " + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/perl.exp b/test/lib/completions/perl.exp similarity index 64% rename from test/lib/completions_to_review/perl.exp rename to test/lib/completions/perl.exp index 8e61e2d4..4b463383 100644 --- a/test/lib/completions_to_review/perl.exp +++ b/test/lib/completions/perl.exp @@ -1,23 +1,17 @@ proc setup {} { + save_env }; # setup() proc teardown {} { + assert_env_unmodified }; # teardown() setup -set test "Tab should show completions" - # Try completion -set cmd "perl " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*\r\n/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +assert_complete_any "perl " sync_after_int @@ -40,7 +34,7 @@ set test "-I without space should complete directories" set cmd "perl -Ifixture1/" send "$cmd\t" expect { - -re "^$cmd\r\n(\.svn/ +|)bar bar.d/ +foo.d/ *(\.svn/ *|)\r\n/@$cmd$" { pass "$test" } + -re "^$cmd\r\nbar bar.d/ +foo.d/ *\r\n/@$cmd$" { pass "$test" } -re /@ { unresolved "$test at prompt" } -re eof { unresolved "eof" } } @@ -53,7 +47,7 @@ set test "-I with space should complete directories" set cmd "perl -I fixture1/" send "$cmd\t" expect { - -re "^$cmd\r\n(\.svn/ +|)bar bar.d/ +foo.d/ *(\.svn/ *|)\r\n/@$cmd$" { pass "$test" } + -re "^$cmd\r\nbar bar.d/ +foo.d/ *\r\n/@$cmd$" { pass "$test" } -re /@ { unresolved "$test at prompt" } -re eof { unresolved "eof" } } @@ -89,14 +83,10 @@ sync_after_int set test "- should complete options" - # Try completion -set cmd "perl -" -send "$cmd\t" -expect { - -re "^$cmd\r\n-0 +-a +-c +-C +-d +-D +-e +-F +-h +-i +-I +-l +-m +-M +-n +-p +-P +-s +-S +-T +-u +-U +-v +-V +-w +-W +-x +-X\r\n/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +set options { + -0 -a -c -C -d -D -e -F -h -i -I -l -m -M -n -p -P -s -S -T -u -U -v -V -w -W -x -X +} +assert_complete $options "perl -" sync_after_int diff --git a/test/lib/completions/perldoc.exp b/test/lib/completions/perldoc.exp new file mode 100644 index 00000000..01eab998 --- /dev/null +++ b/test/lib/completions/perldoc.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "perldoc -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pine.exp b/test/lib/completions/pine.exp new file mode 100644 index 00000000..0a0c3f40 --- /dev/null +++ b/test/lib/completions/pine.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pine " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pkg-config.exp b/test/lib/completions/pkg-config.exp new file mode 100644 index 00000000..477dba08 --- /dev/null +++ b/test/lib/completions/pkg-config.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pkg-config -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pkg_deinstall.exp b/test/lib/completions/pkg_deinstall.exp new file mode 100644 index 00000000..fffc5024 --- /dev/null +++ b/test/lib/completions/pkg_deinstall.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pkg_deinstall " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pkg_delete.exp b/test/lib/completions/pkg_delete.exp new file mode 100644 index 00000000..b0c1a2a5 --- /dev/null +++ b/test/lib/completions/pkg_delete.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pkg_delete " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pkg_info.exp b/test/lib/completions/pkg_info.exp new file mode 100644 index 00000000..3f253ccf --- /dev/null +++ b/test/lib/completions/pkg_info.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pkg_info " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/portinstall.exp b/test/lib/completions/portinstall.exp new file mode 100644 index 00000000..677ac657 --- /dev/null +++ b/test/lib/completions/portinstall.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "portinstall " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/portupgrade.exp b/test/lib/completions/portupgrade.exp new file mode 100644 index 00000000..e80281b4 --- /dev/null +++ b/test/lib/completions/portupgrade.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "portupgrade " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/povray.exp b/test/lib/completions/povray.exp new file mode 100644 index 00000000..1efeeddb --- /dev/null +++ b/test/lib/completions/povray.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "povray " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pr.exp b/test/lib/completions/pr.exp new file mode 100644 index 00000000..5d7a96c3 --- /dev/null +++ b/test/lib/completions/pr.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pr " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/psql.exp b/test/lib/completions/psql.exp new file mode 100644 index 00000000..56d56666 --- /dev/null +++ b/test/lib/completions/psql.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "psql -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ptx.exp b/test/lib/completions/ptx.exp new file mode 100644 index 00000000..2defe049 --- /dev/null +++ b/test/lib/completions/ptx.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ptx " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pvchange.exp b/test/lib/completions/pvchange.exp new file mode 100644 index 00000000..fd4b73d0 --- /dev/null +++ b/test/lib/completions/pvchange.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvchange --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pvcreate.exp b/test/lib/completions/pvcreate.exp new file mode 100644 index 00000000..47cebf7a --- /dev/null +++ b/test/lib/completions/pvcreate.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvcreate --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pvdisplay.exp b/test/lib/completions/pvdisplay.exp new file mode 100644 index 00000000..151064cd --- /dev/null +++ b/test/lib/completions/pvdisplay.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvdisplay --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pvmove.exp b/test/lib/completions/pvmove.exp new file mode 100644 index 00000000..81c05e98 --- /dev/null +++ b/test/lib/completions/pvmove.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvmove --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pvremove.exp b/test/lib/completions/pvremove.exp new file mode 100644 index 00000000..dd145bf6 --- /dev/null +++ b/test/lib/completions/pvremove.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvremove --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pvs.exp b/test/lib/completions/pvs.exp new file mode 100644 index 00000000..6e5527e1 --- /dev/null +++ b/test/lib/completions/pvs.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvs --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/pvscan.exp b/test/lib/completions/pvscan.exp new file mode 100644 index 00000000..e92cdbe0 --- /dev/null +++ b/test/lib/completions/pvscan.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvscan --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/python.exp b/test/lib/completions/python.exp new file mode 100644 index 00000000..c9d70b43 --- /dev/null +++ b/test/lib/completions/python.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "python " + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/p4.exp b/test/lib/completions_to_review/p4.exp deleted file mode 100644 index 1b26cfca..00000000 --- a/test/lib/completions_to_review/p4.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "p4 " -send "$cmd\t" -expect { - -re "^${cmd}(bash: p4: command not found|)\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/paste.exp b/test/lib/completions_to_review/paste.exp deleted file mode 100644 index 5d6c3c85..00000000 --- a/test/lib/completions_to_review/paste.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "paste " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/patch.exp b/test/lib/completions_to_review/patch.exp deleted file mode 100644 index c3015c11..00000000 --- a/test/lib/completions_to_review/patch.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "patch " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/perldoc.exp b/test/lib/completions_to_review/perldoc.exp deleted file mode 100644 index ac8a18f8..00000000 --- a/test/lib/completions_to_review/perldoc.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "perldoc -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pine.exp b/test/lib/completions_to_review/pine.exp deleted file mode 100644 index cb4396c3..00000000 --- a/test/lib/completions_to_review/pine.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pine " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pkg-config.exp b/test/lib/completions_to_review/pkg-config.exp deleted file mode 100644 index 67094dd6..00000000 --- a/test/lib/completions_to_review/pkg-config.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pkg-config -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pkg_deinstall.exp b/test/lib/completions_to_review/pkg_deinstall.exp deleted file mode 100644 index 700a5bea..00000000 --- a/test/lib/completions_to_review/pkg_deinstall.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pkg_deinstall " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pkg_delete.exp b/test/lib/completions_to_review/pkg_delete.exp deleted file mode 100644 index fc82066e..00000000 --- a/test/lib/completions_to_review/pkg_delete.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pkg_delete " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pkg_info.exp b/test/lib/completions_to_review/pkg_info.exp deleted file mode 100644 index 66bc0e16..00000000 --- a/test/lib/completions_to_review/pkg_info.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pkg_info " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/portinstall.exp b/test/lib/completions_to_review/portinstall.exp deleted file mode 100644 index 36a6f0b0..00000000 --- a/test/lib/completions_to_review/portinstall.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "portinstall " -send "$cmd\t" -expect { - -re "^${cmd}(bash: /usr/ports//INDEX: No such file or directory\r\n)*\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/portupgrade.exp b/test/lib/completions_to_review/portupgrade.exp deleted file mode 100644 index b345f1a3..00000000 --- a/test/lib/completions_to_review/portupgrade.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "portupgrade " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/povray.exp b/test/lib/completions_to_review/povray.exp deleted file mode 100644 index bada2cc6..00000000 --- a/test/lib/completions_to_review/povray.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "povray " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pr.exp b/test/lib/completions_to_review/pr.exp deleted file mode 100644 index a7f4f57d..00000000 --- a/test/lib/completions_to_review/pr.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pr " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/psql.exp b/test/lib/completions_to_review/psql.exp deleted file mode 100644 index 19f5a8a5..00000000 --- a/test/lib/completions_to_review/psql.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "psql " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ptx.exp b/test/lib/completions_to_review/ptx.exp deleted file mode 100644 index 95c93443..00000000 --- a/test/lib/completions_to_review/ptx.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ptx " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pvchange.exp b/test/lib/completions_to_review/pvchange.exp deleted file mode 100644 index 190ee415..00000000 --- a/test/lib/completions_to_review/pvchange.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pvchange --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pvcreate.exp b/test/lib/completions_to_review/pvcreate.exp deleted file mode 100644 index 795c8f23..00000000 --- a/test/lib/completions_to_review/pvcreate.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pvcreate --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pvdisplay.exp b/test/lib/completions_to_review/pvdisplay.exp deleted file mode 100644 index e10fbe0e..00000000 --- a/test/lib/completions_to_review/pvdisplay.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pvdisplay --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pvmove.exp b/test/lib/completions_to_review/pvmove.exp deleted file mode 100644 index 9c0f70e4..00000000 --- a/test/lib/completions_to_review/pvmove.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pvmove --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pvremove.exp b/test/lib/completions_to_review/pvremove.exp deleted file mode 100644 index cb89bd2f..00000000 --- a/test/lib/completions_to_review/pvremove.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pvremove --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pvs.exp b/test/lib/completions_to_review/pvs.exp deleted file mode 100644 index a8a5758b..00000000 --- a/test/lib/completions_to_review/pvs.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pvs --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/pvscan.exp b/test/lib/completions_to_review/pvscan.exp deleted file mode 100644 index 7ffb4847..00000000 --- a/test/lib/completions_to_review/pvscan.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "pvscan --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/python.exp b/test/lib/completions_to_review/python.exp deleted file mode 100644 index 0889d43f..00000000 --- a/test/lib/completions_to_review/python.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "python " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From ddb0571227508f17b4102e3f2957e0c3ddc9ca35 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 24 Jul 2009 12:33:30 +0200 Subject: [PATCH 27/69] Reviewed tests q* & r* Added .swp (vim backup) files to .gitignore --- .gitignore | 1 + test/_completion_to_review/qrunner.exp | 1 - test/_completion_to_review/querybts.exp | 1 - test/_completion_to_review/rcs.exp | 1 - test/_completion_to_review/rcsdiff.exp | 1 - test/_completion_to_review/readelf.exp | 1 - test/_completion_to_review/readonly.exp | 1 - test/_completion_to_review/remove_members.exp | 1 - test/_completion_to_review/removepkg.exp | 1 - test/_completion_to_review/renice.exp | 1 - test/_completion_to_review/reportbug.exp | 1 - test/_completion_to_review/ri.exp | 1 - test/_completion_to_review/rlog.exp | 1 - test/_completion_to_review/rm.exp | 1 - test/_completion_to_review/rmdir.exp | 1 - test/_completion_to_review/rmlist.exp | 1 - test/_completion_to_review/rsync.exp | 1 - test/completion/qrunner.exp | 3 ++ test/completion/querybts.exp | 3 ++ test/completion/rcs.exp | 3 ++ test/completion/rcsdiff.exp | 3 ++ .../rdict.exp | 0 test/completion/readelf.exp | 3 ++ test/completion/readonly.exp | 3 ++ test/completion/remove_members.exp | 3 ++ test/completion/removepkg.exp | 3 ++ test/completion/renice.exp | 3 ++ test/completion/reportbug.exp | 3 ++ test/completion/ri.exp | 3 ++ test/completion/rlog.exp | 3 ++ test/completion/rm.exp | 3 ++ test/completion/rmdir.exp | 3 ++ test/completion/rmlist.exp | 3 ++ test/completion/rsync.exp | 3 ++ test/lib/completions/qrunner.exp | 20 +++++++++ test/lib/completions/querybts.exp | 20 +++++++++ test/lib/completions/rcs.exp | 20 +++++++++ test/lib/completions/rcsdiff.exp | 20 +++++++++ test/lib/completions/rdict.exp | 20 +++++++++ test/lib/completions/readelf.exp | 20 +++++++++ test/lib/completions/readonly.exp | 20 +++++++++ test/lib/completions/remove_members.exp | 20 +++++++++ test/lib/completions/removepkg.exp | 20 +++++++++ .../renice.exp | 8 ++-- test/lib/completions/reportbug.exp | 20 +++++++++ test/lib/completions/ri.exp | 20 +++++++++ test/lib/completions/rlog.exp | 20 +++++++++ test/lib/completions/rm.exp | 20 +++++++++ test/lib/completions/rmdir.exp | 20 +++++++++ test/lib/completions/rmlist.exp | 20 +++++++++ test/lib/completions/rsync.exp | 20 +++++++++ test/lib/completions_to_review/qrunner.exp | 26 ------------ test/lib/completions_to_review/querybts.exp | 26 ------------ test/lib/completions_to_review/rcs.exp | 26 ------------ test/lib/completions_to_review/rcsdiff.exp | 26 ------------ test/lib/completions_to_review/rdict.exp | 26 ------------ test/lib/completions_to_review/readelf.exp | 26 ------------ test/lib/completions_to_review/readonly.exp | 26 ------------ .../completions_to_review/remove_members.exp | 26 ------------ test/lib/completions_to_review/removepkg.exp | 29 ------------- test/lib/completions_to_review/reportbug.exp | 41 ------------------- test/lib/completions_to_review/ri.exp | 29 ------------- test/lib/completions_to_review/rlog.exp | 26 ------------ test/lib/completions_to_review/rm.exp | 26 ------------ test/lib/completions_to_review/rmdir.exp | 26 ------------ test/lib/completions_to_review/rmlist.exp | 26 ------------ test/lib/completions_to_review/rsync.exp | 26 ------------ 67 files changed, 374 insertions(+), 456 deletions(-) delete mode 100644 test/_completion_to_review/qrunner.exp delete mode 100644 test/_completion_to_review/querybts.exp delete mode 100644 test/_completion_to_review/rcs.exp delete mode 100644 test/_completion_to_review/rcsdiff.exp delete mode 100644 test/_completion_to_review/readelf.exp delete mode 100644 test/_completion_to_review/readonly.exp delete mode 100644 test/_completion_to_review/remove_members.exp delete mode 100644 test/_completion_to_review/removepkg.exp delete mode 100644 test/_completion_to_review/renice.exp delete mode 100644 test/_completion_to_review/reportbug.exp delete mode 100644 test/_completion_to_review/ri.exp delete mode 100644 test/_completion_to_review/rlog.exp delete mode 100644 test/_completion_to_review/rm.exp delete mode 100644 test/_completion_to_review/rmdir.exp delete mode 100644 test/_completion_to_review/rmlist.exp delete mode 100644 test/_completion_to_review/rsync.exp create mode 100644 test/completion/qrunner.exp create mode 100644 test/completion/querybts.exp create mode 100644 test/completion/rcs.exp create mode 100644 test/completion/rcsdiff.exp rename test/{_completion_to_review => completion}/rdict.exp (100%) create mode 100644 test/completion/readelf.exp create mode 100644 test/completion/readonly.exp create mode 100644 test/completion/remove_members.exp create mode 100644 test/completion/removepkg.exp create mode 100644 test/completion/renice.exp create mode 100644 test/completion/reportbug.exp create mode 100644 test/completion/ri.exp create mode 100644 test/completion/rlog.exp create mode 100644 test/completion/rm.exp create mode 100644 test/completion/rmdir.exp create mode 100644 test/completion/rmlist.exp create mode 100644 test/completion/rsync.exp create mode 100644 test/lib/completions/qrunner.exp create mode 100644 test/lib/completions/querybts.exp create mode 100644 test/lib/completions/rcs.exp create mode 100644 test/lib/completions/rcsdiff.exp create mode 100644 test/lib/completions/rdict.exp create mode 100644 test/lib/completions/readelf.exp create mode 100644 test/lib/completions/readonly.exp create mode 100644 test/lib/completions/remove_members.exp create mode 100644 test/lib/completions/removepkg.exp rename test/lib/{completions_to_review => completions}/renice.exp (72%) create mode 100644 test/lib/completions/reportbug.exp create mode 100644 test/lib/completions/ri.exp create mode 100644 test/lib/completions/rlog.exp create mode 100644 test/lib/completions/rm.exp create mode 100644 test/lib/completions/rmdir.exp create mode 100644 test/lib/completions/rmlist.exp create mode 100644 test/lib/completions/rsync.exp delete mode 100644 test/lib/completions_to_review/qrunner.exp delete mode 100644 test/lib/completions_to_review/querybts.exp delete mode 100644 test/lib/completions_to_review/rcs.exp delete mode 100644 test/lib/completions_to_review/rcsdiff.exp delete mode 100644 test/lib/completions_to_review/rdict.exp delete mode 100644 test/lib/completions_to_review/readelf.exp delete mode 100644 test/lib/completions_to_review/readonly.exp delete mode 100644 test/lib/completions_to_review/remove_members.exp delete mode 100644 test/lib/completions_to_review/removepkg.exp delete mode 100644 test/lib/completions_to_review/reportbug.exp delete mode 100644 test/lib/completions_to_review/ri.exp delete mode 100644 test/lib/completions_to_review/rlog.exp delete mode 100644 test/lib/completions_to_review/rm.exp delete mode 100644 test/lib/completions_to_review/rmdir.exp delete mode 100644 test/lib/completions_to_review/rmlist.exp delete mode 100644 test/lib/completions_to_review/rsync.exp diff --git a/.gitignore b/.gitignore index dccc755a..8f8a93ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.tar* +*.swp Makefile Makefile.in aclocal.m4 diff --git a/test/_completion_to_review/qrunner.exp b/test/_completion_to_review/qrunner.exp deleted file mode 100644 index 2d43a26d..00000000 --- a/test/_completion_to_review/qrunner.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/qrunner.exp" diff --git a/test/_completion_to_review/querybts.exp b/test/_completion_to_review/querybts.exp deleted file mode 100644 index 0b6dbf3d..00000000 --- a/test/_completion_to_review/querybts.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/querybts.exp" diff --git a/test/_completion_to_review/rcs.exp b/test/_completion_to_review/rcs.exp deleted file mode 100644 index ef1c8716..00000000 --- a/test/_completion_to_review/rcs.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/rcs.exp" diff --git a/test/_completion_to_review/rcsdiff.exp b/test/_completion_to_review/rcsdiff.exp deleted file mode 100644 index b87e20a4..00000000 --- a/test/_completion_to_review/rcsdiff.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/rcsdiff.exp" diff --git a/test/_completion_to_review/readelf.exp b/test/_completion_to_review/readelf.exp deleted file mode 100644 index 0fadb9a2..00000000 --- a/test/_completion_to_review/readelf.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/readelf.exp" diff --git a/test/_completion_to_review/readonly.exp b/test/_completion_to_review/readonly.exp deleted file mode 100644 index 0b3b9b75..00000000 --- a/test/_completion_to_review/readonly.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/readonly.exp" diff --git a/test/_completion_to_review/remove_members.exp b/test/_completion_to_review/remove_members.exp deleted file mode 100644 index 1c4a07ee..00000000 --- a/test/_completion_to_review/remove_members.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/remove_members.exp" diff --git a/test/_completion_to_review/removepkg.exp b/test/_completion_to_review/removepkg.exp deleted file mode 100644 index 81027574..00000000 --- a/test/_completion_to_review/removepkg.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/removepkg.exp" diff --git a/test/_completion_to_review/renice.exp b/test/_completion_to_review/renice.exp deleted file mode 100644 index 4ec77a09..00000000 --- a/test/_completion_to_review/renice.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/renice.exp" diff --git a/test/_completion_to_review/reportbug.exp b/test/_completion_to_review/reportbug.exp deleted file mode 100644 index aa27ee69..00000000 --- a/test/_completion_to_review/reportbug.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/reportbug.exp" diff --git a/test/_completion_to_review/ri.exp b/test/_completion_to_review/ri.exp deleted file mode 100644 index 696a43a1..00000000 --- a/test/_completion_to_review/ri.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ri.exp" diff --git a/test/_completion_to_review/rlog.exp b/test/_completion_to_review/rlog.exp deleted file mode 100644 index dc2dea88..00000000 --- a/test/_completion_to_review/rlog.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/rlog.exp" diff --git a/test/_completion_to_review/rm.exp b/test/_completion_to_review/rm.exp deleted file mode 100644 index ac2e09f7..00000000 --- a/test/_completion_to_review/rm.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/rm.exp" diff --git a/test/_completion_to_review/rmdir.exp b/test/_completion_to_review/rmdir.exp deleted file mode 100644 index a298faa1..00000000 --- a/test/_completion_to_review/rmdir.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/rmdir.exp" diff --git a/test/_completion_to_review/rmlist.exp b/test/_completion_to_review/rmlist.exp deleted file mode 100644 index 05a9c2e5..00000000 --- a/test/_completion_to_review/rmlist.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/rmlist.exp" diff --git a/test/_completion_to_review/rsync.exp b/test/_completion_to_review/rsync.exp deleted file mode 100644 index 1fc7cf5f..00000000 --- a/test/_completion_to_review/rsync.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/rsync.exp" diff --git a/test/completion/qrunner.exp b/test/completion/qrunner.exp new file mode 100644 index 00000000..86ead6b0 --- /dev/null +++ b/test/completion/qrunner.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type qrunner]} { + source "lib/completions/qrunner.exp" +}; # if diff --git a/test/completion/querybts.exp b/test/completion/querybts.exp new file mode 100644 index 00000000..36993865 --- /dev/null +++ b/test/completion/querybts.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type querybts]} { + source "lib/completions/querybts.exp" +}; # if diff --git a/test/completion/rcs.exp b/test/completion/rcs.exp new file mode 100644 index 00000000..73c12fdd --- /dev/null +++ b/test/completion/rcs.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type rcs]} { + source "lib/completions/rcs.exp" +}; # if diff --git a/test/completion/rcsdiff.exp b/test/completion/rcsdiff.exp new file mode 100644 index 00000000..354bc2f4 --- /dev/null +++ b/test/completion/rcsdiff.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type rcsdiff]} { + source "lib/completions/rcsdiff.exp" +}; # if diff --git a/test/_completion_to_review/rdict.exp b/test/completion/rdict.exp similarity index 100% rename from test/_completion_to_review/rdict.exp rename to test/completion/rdict.exp diff --git a/test/completion/readelf.exp b/test/completion/readelf.exp new file mode 100644 index 00000000..8b5f2f8d --- /dev/null +++ b/test/completion/readelf.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type readelf]} { + source "lib/completions/readelf.exp" +}; # if diff --git a/test/completion/readonly.exp b/test/completion/readonly.exp new file mode 100644 index 00000000..635c5493 --- /dev/null +++ b/test/completion/readonly.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type readonly]} { + source "lib/completions/readonly.exp" +}; # if diff --git a/test/completion/remove_members.exp b/test/completion/remove_members.exp new file mode 100644 index 00000000..d911a3c7 --- /dev/null +++ b/test/completion/remove_members.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type remove_members]} { + source "lib/completions/remove_members.exp" +}; # if diff --git a/test/completion/removepkg.exp b/test/completion/removepkg.exp new file mode 100644 index 00000000..5d4b9f9a --- /dev/null +++ b/test/completion/removepkg.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type removepkg]} { + source "lib/completions/removepkg.exp" +}; # if diff --git a/test/completion/renice.exp b/test/completion/renice.exp new file mode 100644 index 00000000..0f0637b9 --- /dev/null +++ b/test/completion/renice.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {renice}]} { + source "lib/completions/renice.exp" +}; # if diff --git a/test/completion/reportbug.exp b/test/completion/reportbug.exp new file mode 100644 index 00000000..52419e9b --- /dev/null +++ b/test/completion/reportbug.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type reportbug]} { + source "lib/completions/reportbug.exp" +}; # if diff --git a/test/completion/ri.exp b/test/completion/ri.exp new file mode 100644 index 00000000..f37203f1 --- /dev/null +++ b/test/completion/ri.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type ri]} { + source "lib/completions/ri.exp" +}; # if diff --git a/test/completion/rlog.exp b/test/completion/rlog.exp new file mode 100644 index 00000000..1af971af --- /dev/null +++ b/test/completion/rlog.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type rlog]} { + source "lib/completions/rlog.exp" +}; # if diff --git a/test/completion/rm.exp b/test/completion/rm.exp new file mode 100644 index 00000000..069a0bce --- /dev/null +++ b/test/completion/rm.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type rm]} { + source "lib/completions/rm.exp" +}; # if diff --git a/test/completion/rmdir.exp b/test/completion/rmdir.exp new file mode 100644 index 00000000..32c36c00 --- /dev/null +++ b/test/completion/rmdir.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type rmdir]} { + source "lib/completions/rmdir.exp" +}; # if diff --git a/test/completion/rmlist.exp b/test/completion/rmlist.exp new file mode 100644 index 00000000..6efcc4bb --- /dev/null +++ b/test/completion/rmlist.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type rmlist]} { + source "lib/completions/rmlist.exp" +}; # if diff --git a/test/completion/rsync.exp b/test/completion/rsync.exp new file mode 100644 index 00000000..6adf043a --- /dev/null +++ b/test/completion/rsync.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type rsync]} { + source "lib/completions/rsync.exp" +}; # if diff --git a/test/lib/completions/qrunner.exp b/test/lib/completions/qrunner.exp new file mode 100644 index 00000000..b8fcf191 --- /dev/null +++ b/test/lib/completions/qrunner.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "qrunner -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/querybts.exp b/test/lib/completions/querybts.exp new file mode 100644 index 00000000..dc75cd62 --- /dev/null +++ b/test/lib/completions/querybts.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "querybts --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/rcs.exp b/test/lib/completions/rcs.exp new file mode 100644 index 00000000..19ae4d50 --- /dev/null +++ b/test/lib/completions/rcs.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rcs " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/rcsdiff.exp b/test/lib/completions/rcsdiff.exp new file mode 100644 index 00000000..8383cdb9 --- /dev/null +++ b/test/lib/completions/rcsdiff.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rcsdiff " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/rdict.exp b/test/lib/completions/rdict.exp new file mode 100644 index 00000000..aa132617 --- /dev/null +++ b/test/lib/completions/rdict.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rdict --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/readelf.exp b/test/lib/completions/readelf.exp new file mode 100644 index 00000000..a084a41e --- /dev/null +++ b/test/lib/completions/readelf.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "readelf --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/readonly.exp b/test/lib/completions/readonly.exp new file mode 100644 index 00000000..84be3c96 --- /dev/null +++ b/test/lib/completions/readonly.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "readonly BASH_ARG" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/remove_members.exp b/test/lib/completions/remove_members.exp new file mode 100644 index 00000000..63d6a70e --- /dev/null +++ b/test/lib/completions/remove_members.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "remove_members --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/removepkg.exp b/test/lib/completions/removepkg.exp new file mode 100644 index 00000000..7cf98805 --- /dev/null +++ b/test/lib/completions/removepkg.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "removepkg " + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/renice.exp b/test/lib/completions/renice.exp similarity index 72% rename from test/lib/completions_to_review/renice.exp rename to test/lib/completions/renice.exp index 8e499c78..c91e0212 100644 --- a/test/lib/completions_to_review/renice.exp +++ b/test/lib/completions/renice.exp @@ -1,20 +1,22 @@ proc setup {} { + save_env }; # setup() proc teardown {} { + assert_env_unmodified }; # teardown() setup -set test "Tab should show completions" +set test "Tab should show complete process ids" # Try completion set cmd "renice 1" send "$cmd\t" expect { - -re "$cmd\r\n.*$cmd$" { pass "$test" } + -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" } -re /@ { unresolved "$test at prompt" } -re eof { unresolved "eof" } }; # expect @@ -28,7 +30,7 @@ set test "Tab should show complete process group ids" set cmd "renice -g " send "$cmd\t" expect { - -re "$cmd$" { pass "$test" } + -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" } -re /@ { unresolved "$test at prompt" } -re eof { unresolved "eof" } }; # expect diff --git a/test/lib/completions/reportbug.exp b/test/lib/completions/reportbug.exp new file mode 100644 index 00000000..1f66df2c --- /dev/null +++ b/test/lib/completions/reportbug.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "reportbug --m" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ri.exp b/test/lib/completions/ri.exp new file mode 100644 index 00000000..160dc9a7 --- /dev/null +++ b/test/lib/completions/ri.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ri " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/rlog.exp b/test/lib/completions/rlog.exp new file mode 100644 index 00000000..cbc06857 --- /dev/null +++ b/test/lib/completions/rlog.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rlog " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/rm.exp b/test/lib/completions/rm.exp new file mode 100644 index 00000000..ae670e83 --- /dev/null +++ b/test/lib/completions/rm.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rm " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/rmdir.exp b/test/lib/completions/rmdir.exp new file mode 100644 index 00000000..2b23a9c5 --- /dev/null +++ b/test/lib/completions/rmdir.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rmdir " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/rmlist.exp b/test/lib/completions/rmlist.exp new file mode 100644 index 00000000..91519ee8 --- /dev/null +++ b/test/lib/completions/rmlist.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rmlist -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/rsync.exp b/test/lib/completions/rsync.exp new file mode 100644 index 00000000..fb301a35 --- /dev/null +++ b/test/lib/completions/rsync.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rsync " + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/qrunner.exp b/test/lib/completions_to_review/qrunner.exp deleted file mode 100644 index db79bd08..00000000 --- a/test/lib/completions_to_review/qrunner.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "qrunner -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/querybts.exp b/test/lib/completions_to_review/querybts.exp deleted file mode 100644 index 9d3b2a01..00000000 --- a/test/lib/completions_to_review/querybts.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "querybts --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/rcs.exp b/test/lib/completions_to_review/rcs.exp deleted file mode 100644 index 9181cac6..00000000 --- a/test/lib/completions_to_review/rcs.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "rcs " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/rcsdiff.exp b/test/lib/completions_to_review/rcsdiff.exp deleted file mode 100644 index b8b0093c..00000000 --- a/test/lib/completions_to_review/rcsdiff.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "rcsdiff " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/rdict.exp b/test/lib/completions_to_review/rdict.exp deleted file mode 100644 index 8f42d9da..00000000 --- a/test/lib/completions_to_review/rdict.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "rdict --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/readelf.exp b/test/lib/completions_to_review/readelf.exp deleted file mode 100644 index 60ddad77..00000000 --- a/test/lib/completions_to_review/readelf.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "readelf " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/readonly.exp b/test/lib/completions_to_review/readonly.exp deleted file mode 100644 index 1ed5730d..00000000 --- a/test/lib/completions_to_review/readonly.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "readonly BASH_ARG" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/remove_members.exp b/test/lib/completions_to_review/remove_members.exp deleted file mode 100644 index 8fad0ad4..00000000 --- a/test/lib/completions_to_review/remove_members.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "remove_members --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/removepkg.exp b/test/lib/completions_to_review/removepkg.exp deleted file mode 100644 index 54e47aa2..00000000 --- a/test/lib/completions_to_review/removepkg.exp +++ /dev/null @@ -1,29 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "removepkg " -send "$cmd\t" - # NOTE: Wait in case `kldload' isn't installed, so that "^$cdm.*$" doesn't match - # before comp_install has finished -sleep .4 -expect { - -re "^$cmd.*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/reportbug.exp b/test/lib/completions_to_review/reportbug.exp deleted file mode 100644 index 234b82e6..00000000 --- a/test/lib/completions_to_review/reportbug.exp +++ /dev/null @@ -1,41 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "reportbug --m" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -set test "Completing --editor should invoke _command" - # Try completion -set cmd "reportbug --editor vim" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ri.exp b/test/lib/completions_to_review/ri.exp deleted file mode 100644 index df4d2b22..00000000 --- a/test/lib/completions_to_review/ri.exp +++ /dev/null @@ -1,29 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ri " -send "$cmd\t" - # NOTE: Wait in case `ri' isn't installed, so that "^$cdm.*$" doesn't match - # before comp_install has finished -sleep 1 -expect { - -re "^$cmd.*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/rlog.exp b/test/lib/completions_to_review/rlog.exp deleted file mode 100644 index 2446334a..00000000 --- a/test/lib/completions_to_review/rlog.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "rlog " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/rm.exp b/test/lib/completions_to_review/rm.exp deleted file mode 100644 index 932eb4cb..00000000 --- a/test/lib/completions_to_review/rm.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "rm " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/rmdir.exp b/test/lib/completions_to_review/rmdir.exp deleted file mode 100644 index c668b313..00000000 --- a/test/lib/completions_to_review/rmdir.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "rmdir " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/rmlist.exp b/test/lib/completions_to_review/rmlist.exp deleted file mode 100644 index 0f3ab102..00000000 --- a/test/lib/completions_to_review/rmlist.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "rmlist -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/rsync.exp b/test/lib/completions_to_review/rsync.exp deleted file mode 100644 index e874b53b..00000000 --- a/test/lib/completions_to_review/rsync.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should show completions" - # Try completion -set cmd "rsync " -send "$cmd\t" -expect { - -re "$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From 6d31b150110d1b1a3b3d789bb2cf197f09110267 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sat, 25 Jul 2009 09:35:03 +0200 Subject: [PATCH 28/69] 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. --- bash_completion | 8 ++++++-- test/completion/ping.exp | 3 +++ test/lib/completions/ping.exp | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 test/completion/ping.exp create mode 100644 test/lib/completions/ping.exp diff --git a/bash_completion b/bash_completion index c17a5645..08d9f867 100644 --- a/bash_completion +++ b/bash_completion @@ -1052,10 +1052,14 @@ shopt -u hostcomplete && complete -F _user_at_host $nospace talk ytalk finger # `_known_hosts_real' instead. _known_hosts() { + local options COMPREPLY=() - # NOTE: Passing "$@" is deprecated. See NOTE above. - _known_hosts_real "$@" "$(_get_cword)" + # NOTE: Using `_known_hosts' as a helper function and passing options + # to `_known_hosts' is deprecated: Use `_known_hosts_real' instead. + [ "$1" = -a ] || [ "$2" = -a ] && options=-a + [ "$1" = -c ] || [ "$2" = -c ] && options="$options -c" + _known_hosts_real $options "$(_get_cword)" } # Helper function for completing _known_hosts. diff --git a/test/completion/ping.exp b/test/completion/ping.exp new file mode 100644 index 00000000..994751b1 --- /dev/null +++ b/test/completion/ping.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type ping]} { + source "lib/completions/ping.exp" +}; # if diff --git a/test/lib/completions/ping.exp b/test/lib/completions/ping.exp new file mode 100644 index 00000000..b600849b --- /dev/null +++ b/test/lib/completions/ping.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ping " + + +sync_after_int + + +teardown From 328bd6024286a713e6f99fc7183e5deb5c553609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 25 Jul 2009 13:36:35 +0300 Subject: [PATCH 29/69] Add missing line continuation backslash (cosmetic, no functional changes). --- contrib/openssl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/openssl b/contrib/openssl index 9835a6c1..d4abdc11 100644 --- a/contrib/openssl +++ b/contrib/openssl @@ -217,7 +217,7 @@ _openssl() -crl_check_all -cert -certform \ -key -keyform -pass -dcert \ -dcertform -dkey -dkeyform \ - -dpass -dhparam -nbio + -dpass -dhparam -nbio \ -nbio_test -crlf -debug -msg \ -state -CApath -CAfile -nocert \ -cipher -quiet -no_tmp_rsa \ From c6360dde51e4e777a765d20852b2e452a8e6221d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 25 Jul 2009 13:38:42 +0300 Subject: [PATCH 30/69] Trim trailing whitespace (cosmetic, no functional changes). --- bash_completion | 26 +++++++++++++------------- contrib/apache2ctl | 6 +++--- contrib/apt | 2 +- contrib/bluez-utils | 8 ++++---- contrib/cksfv | 6 +++--- contrib/cpan2dist | 2 +- contrib/gnatmake | 2 +- contrib/gpg2 | 6 +++--- contrib/imagemagick | 2 +- contrib/isql | 2 +- contrib/java | 4 ++-- contrib/mailman | 2 +- contrib/make | 2 +- contrib/man | 2 +- contrib/monodevelop | 8 ++++---- contrib/mtx | 8 ++++---- contrib/openssl | 2 +- contrib/qdbus | 2 +- contrib/ri | 2 +- contrib/rpm | 2 +- contrib/strace | 4 ++-- contrib/unace | 4 ++-- contrib/unrar | 4 ++-- contrib/vncviewer | 4 ++-- contrib/vpnc | 2 +- contrib/xm | 2 +- 26 files changed, 58 insertions(+), 58 deletions(-) diff --git a/bash_completion b/bash_completion index 08d9f867..6d2698c0 100644 --- a/bash_completion +++ b/bash_completion @@ -214,7 +214,7 @@ quote() echo \'${1//\'/\'\\\'\'}\' #'# Help vim syntax highlighting } -# This function quotes the argument in a way so that readline dequoting +# This function quotes the argument in a way so that readline dequoting # results in the original argument quote_readline() { @@ -265,9 +265,9 @@ _get_cword() index="$(( index - old_size + new_size ))" fi done - + if [[ "${COMP_WORDS[COMP_CWORD]:0:${#cur}}" != "$cur" ]]; then - # We messed up! At least return the whole word so things + # We messed up! At least return the whole word so things # keep working printf "%s" "${COMP_WORDS[COMP_CWORD]}" else @@ -289,16 +289,16 @@ _filedir() local -a toks local tmp - + # TODO: I've removed a "[ -n $tmp ] &&" before `echo $tmp', # and everything works again. If this bug # suddenly appears again (i.e. "cd /b" # becomes "cd /"), remember to check for # other similar conditionals (here and # _filedir_xspec()). --David - # NOTE: The comment above has been moved outside of the subshell below, + # NOTE: The comment above has been moved outside of the subshell below, # because quotes-in-comments-in-a-subshell cause errors on - # bash-3.1. See also: + # bash-3.1. See also: # http://www.mail-archive.com/bug-bash@gnu.org/msg01667.html toks=( ${toks[@]-} $( compgen -d -- "$(quote_readline "$cur")" | { @@ -307,7 +307,7 @@ _filedir() done } )) - + if [[ "$1" != -d ]]; then xspec=${1:+"!*.$1"} toks=( ${toks[@]-} $( @@ -732,7 +732,7 @@ _chgrp() fi $split && return 0 - + # options completion if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \ @@ -1048,7 +1048,7 @@ _user_at_host() { } shopt -u hostcomplete && complete -F _user_at_host $nospace talk ytalk finger -# NOTE: Using this function as a helper function is deprecated. Use +# NOTE: Using this function as a helper function is deprecated. Use # `_known_hosts_real' instead. _known_hosts() { @@ -1354,7 +1354,7 @@ _command_offset() # get function name func=${cspec#*-F } func=${func%% *} - + if [[ ${#COMP_WORDS[@]} -ge 2 ]]; then $func $cmd "${COMP_WORDS[${#COMP_WORDS[@]}-1]}" "${COMP_WORDS[${#COMP_WORDS[@]}-2]}" else @@ -1498,7 +1498,7 @@ _filedir_xspec() done } )) - + toks=( ${toks[@]-} $( eval compgen -f -X "$xspec" -- "\$(quote_readline "\$cur")" | { while read -r tmp; do @@ -1506,7 +1506,7 @@ _filedir_xspec() done } )) - + COMPREPLY=( "${toks[@]}" ) } list=( $( sed -ne '/^# START exclude/,/^# FINISH exclude/p' \ @@ -1538,7 +1538,7 @@ if [ -d $BASH_COMPLETION_COMPAT_DIR -a -r $BASH_COMPLETION_COMPAT_DIR -a \ -x $BASH_COMPLETION_COMPAT_DIR ]; then for i in $BASH_COMPLETION_COMPAT_DIR/*; do [[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) ]] && - [ \( -f $i -o -h $i \) -a -r $i ] && . $i + [ \( -f $i -o -h $i \) -a -r $i ] && . $i done fi if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \ diff --git a/contrib/apache2ctl b/contrib/apache2ctl index 8794b4a9..1153b62f 100644 --- a/contrib/apache2ctl +++ b/contrib/apache2ctl @@ -6,12 +6,12 @@ have apache2ctl && { _apache2ctl() { local APWORDS - + COMPREPLY=() cur=`_get_cword` - + APWORDS=$(apache2ctl 2>&1 >/dev/null | head -n1 | cut -f3 -d" " | tr "|" " ") - + COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) ) } complete -F _apache2ctl apache2ctl diff --git a/contrib/apt b/contrib/apt index d3bf26b0..366e5af7 100644 --- a/contrib/apt +++ b/contrib/apt @@ -116,7 +116,7 @@ _apt_cache() uniq | cut -f2 -d" " ) ) return 0 ;; - + *) COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) return 0 diff --git a/contrib/bluez-utils b/contrib/bluez-utils index 8300ef2b..55867758 100644 --- a/contrib/bluez-utils +++ b/contrib/bluez-utils @@ -31,7 +31,7 @@ _bluetooth_packet_types() $cur ) ) } -_get_command() +_get_command() { local i @@ -163,7 +163,7 @@ _sdptool() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--bdaddr \ --tree --raw --xml' -- $cur ) ) - else + else _bluetooth_services fi ;; @@ -171,7 +171,7 @@ _sdptool() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--tree \ --raw --xml' -- $cur ) ) - else + else _bluetooth_adresses fi ;; @@ -352,7 +352,7 @@ _hciconfig() voice iac inqmode inqdata inqtype inqparams \ pageparms pageto afhmode aclmtu scomtu putkey \ delkey commands features version revision lm' \ - -- $cur ) ) + -- $cur ) ) fi else case $command in diff --git a/contrib/cksfv b/contrib/cksfv index cbb8c0aa..b8758709 100644 --- a/contrib/cksfv +++ b/contrib/cksfv @@ -8,12 +8,12 @@ _cksfv() { COMPREPLY=() cur=`_get_cword` - + if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W '-C -f -i -q -v' -- $cur ) ) return 0 fi - + case "${COMP_WORDS[$COMP_CWORD-1]}" in -C) _filedir -d @@ -24,7 +24,7 @@ _cksfv() return 0 ;; esac - + _filedir return 0 } && diff --git a/contrib/cpan2dist b/contrib/cpan2dist index caec18fa..d0281153 100644 --- a/contrib/cpan2dist +++ b/contrib/cpan2dist @@ -39,7 +39,7 @@ _cpan2dist() done COMPREPLY=( $( zgrep "^${cur//-/::}" \ $packagelist 2>/dev/null \ - | awk '{print $1}' | sed -e 's/::/-/g' ) ) + | awk '{print $1}' | sed -e 's/::/-/g' ) ) fi } && complete -F _cpan2dist $default cpan2dist diff --git a/contrib/gnatmake b/contrib/gnatmake index 5a437874..6b45212c 100644 --- a/contrib/gnatmake +++ b/contrib/gnatmake @@ -27,7 +27,7 @@ _gnatmake() else # source file completion _filedir '@(adb|ads)' - + fi } && complete -F _gnatmake $filenames gnatmake diff --git a/contrib/gpg2 b/contrib/gpg2 index c41aa0af..e46fda97 100644 --- a/contrib/gpg2 +++ b/contrib/gpg2 @@ -7,11 +7,11 @@ have gpg2 && { _gpg2 () { local cur prev - + COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} - + case "$prev" in --homedir) _filedir -d @@ -34,7 +34,7 @@ _gpg2 () return 0 ;; esac - + if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-s -b -e -c -d -k -K -a -r -u -z -o -v \ -n -N -i -h -R -t $(gpg2 --dump-options)' -- $cur ) ) diff --git a/contrib/imagemagick b/contrib/imagemagick index ccad88f0..d0769f49 100644 --- a/contrib/imagemagick +++ b/contrib/imagemagick @@ -522,7 +522,7 @@ _stream() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-authenticate -channel -colorspace \ - -compress -debug -define -density -depth -extract \ + -compress -debug -define -density -depth -extract \ -help -identify -interlace -interpolate -limit -list \ -log -map -monitor -quantize -quiet -regard-warnings \ -respect-parenthesis -sampling-factor -seed -set \ diff --git a/contrib/isql b/contrib/isql index 1ebf1726..a856ef2b 100644 --- a/contrib/isql +++ b/contrib/isql @@ -8,7 +8,7 @@ _isql() { local cur cur=`_get_cword` - + [ -f "$ODBCINI" ] && COMPREPLY=( $( grep \\[$cur "$ODBCINI" | tr -d \\[\\] ) ) } && complete -F _isql isql diff --git a/contrib/java b/contrib/java index 1e706907..1d76a8d7 100644 --- a/contrib/java +++ b/contrib/java @@ -75,12 +75,12 @@ _java_classes() elif [ -d $i ]; then i=${i%/} - + # See Debian bug #496828 COMPREPLY=( "${COMPREPLY[@]}" $( find "$i" -type f \ -maxdepth 1 -path "$i/$cur*.class" 2>/dev/null | \ grep -v "\\$" | sed -e "s|^$i/||" ) ) - + # FIXME: if we have foo.class and foo/, the completion # returns "foo/"... how to give precedence to files # over directories? diff --git a/contrib/mailman b/contrib/mailman index a7999d97..5b19dff6 100644 --- a/contrib/mailman +++ b/contrib/mailman @@ -424,7 +424,7 @@ _arch() 1) _mailman_lists ;; - 2) + 2) _filedir ;; esac diff --git a/contrib/make b/contrib/make index 830b26d3..d1c5ac05 100644 --- a/contrib/make +++ b/contrib/make @@ -63,7 +63,7 @@ _make() [ -n "$makef" ] && makef="-f ${makef}" [ -n "$makef_dir" ] && makef_dir="-C ${makef_dir}" - + COMPREPLY=( $( compgen -W "$( make -qp $makef $makef_dir 2>/dev/null | \ awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \ {split($1,A,/ /);for(i in A)print A[i]}' )" \ diff --git a/contrib/man b/contrib/man index 1e409d33..89bf877a 100644 --- a/contrib/man +++ b/contrib/man @@ -16,7 +16,7 @@ _man() COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} - + if [[ "$prev" == -l ]]; then _filedir $manext return 0 diff --git a/contrib/monodevelop b/contrib/monodevelop index 3d8430cb..94570d6c 100644 --- a/contrib/monodevelop +++ b/contrib/monodevelop @@ -8,7 +8,7 @@ _monodevelop() { local cur cur=`_get_cword` - + if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-? -help \ -help2 \ @@ -33,7 +33,7 @@ _mdtool() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} - + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do if [[ ${COMP_WORDS[i]} == @(build|generate-makefiles|setup) ]]; then command=${COMP_WORDS[i]} @@ -87,11 +87,11 @@ _mdtool() ;; esac fi - + COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \ generate-makefiles gettext-update \ setup -q' -- "$cur" ) ) - + return 0 } && complete -F _mdtool $filenames mdtool diff --git a/contrib/mtx b/contrib/mtx index 3ac0f6d3..7d5f2cc0 100644 --- a/contrib/mtx +++ b/contrib/mtx @@ -7,7 +7,7 @@ have mtx && _mtx() { local cur prev options tapes drives - + COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} @@ -25,9 +25,9 @@ _mtx() drives=${drives//:Empty} if [ $COMP_CWORD -gt 1 ]; then - case $prev in - load) - COMPREPLY=( $( compgen -W "$tapes" -- $cur ) ) + case $prev in + load) + COMPREPLY=( $( compgen -W "$tapes" -- $cur ) ) ;; unload|first|last|next) COMPREPLY=( $( compgen -W "$drives" -- $cur ) ) diff --git a/contrib/openssl b/contrib/openssl index d4abdc11..db46592e 100644 --- a/contrib/openssl +++ b/contrib/openssl @@ -209,7 +209,7 @@ _openssl() -no_tls1 -bugs -cipher \ -starttls -engine -tlsextdebug \ -no_ticket -sess_out -sess_in \ - -rand' + -rand' ;; s_server) options='-accept -context -verify \ diff --git a/contrib/qdbus b/contrib/qdbus index ba749c6a..9f697b47 100644 --- a/contrib/qdbus +++ b/contrib/qdbus @@ -7,7 +7,7 @@ have qdbus && _qdbus() { local cur compstr - + COMPREPLY=() cur=`_get_cword` if [ -z "$cur" ]; then diff --git a/contrib/ri b/contrib/ri index 25c4e060..cfe3f35b 100644 --- a/contrib/ri +++ b/contrib/ri @@ -59,7 +59,7 @@ _ri() method=${cur#*$separator} classes=( $class ) prefix="-P $class$separator" - ri_get_methods + ri_get_methods return 0 fi diff --git a/contrib/rpm b/contrib/rpm index 643e0a21..e6ede170 100644 --- a/contrib/rpm +++ b/contrib/rpm @@ -33,7 +33,7 @@ _rpm_nodigsig() { if [ -z "$nodig" -a -z "$nosig" ]; then local rpmver - + rpmver=$(rpm --version) rpmver=${rpmver##* } diff --git a/contrib/strace b/contrib/strace index bf9878f4..f9aef75e 100644 --- a/contrib/strace +++ b/contrib/strace @@ -3,7 +3,7 @@ # # bash completion for strace -have strace && +have strace && _strace() { local cur prev offset i syscalls arch unistd @@ -38,7 +38,7 @@ _strace() if [[ "$cur" == *=* ]]; then prev=${cur/=*/} cur=${cur/*=/} - + # Import arch-specific syscalls -- not foolproof IMHO #+ --David Paleino arch=$(command uname -m) diff --git a/contrib/unace b/contrib/unace index d63841ad..2e05e8ce 100644 --- a/contrib/unace +++ b/contrib/unace @@ -4,7 +4,7 @@ # unace(1) completion by Guillaume Rousse have unace && -_unace() +_unace() { local cur @@ -23,7 +23,7 @@ _unace() fi ;; esac - + return 0 } && diff --git a/contrib/unrar b/contrib/unrar index b467885e..ec193b30 100644 --- a/contrib/unrar +++ b/contrib/unrar @@ -4,7 +4,7 @@ # unrar(1) completion by Guillaume Rousse have unrar && -_unrar() +_unrar() { local cur @@ -25,7 +25,7 @@ _unrar() fi ;; esac - + return 0 } && complete -F _unrar $filenames unrar diff --git a/contrib/vncviewer b/contrib/vncviewer index 52db0062..4b960e46 100644 --- a/contrib/vncviewer +++ b/contrib/vncviewer @@ -7,7 +7,7 @@ have vncviewer && _vncviewer_bootstrap() { local fname case "$(_realcommand vncviewer)" in - # If `vncviewer' not installed, default file-dir completion + # If `vncviewer' not installed, default file-dir completion '') _filedir `_get_cword` ;; *xvnc4viewer) fname=_xvnc4viewer ;; *tightvncviewer|*) fname=_tightvncviewer ;; @@ -117,7 +117,7 @@ _xvnc4viewer() # Variable 'nocasematch' isn't available; # Convert completions to lowercase COMPREPLY=( $( compgen -W "$( - echo ${options[@]/#/$dash} | tr [:upper:] [:lower:] + echo ${options[@]/#/$dash} | tr [:upper:] [:lower:] )" -- "$(echo "$cur" | tr [:upper:] [:lower:])" ) ) fi else diff --git a/contrib/vpnc b/contrib/vpnc index ef8fdf76..6ab9ad58 100644 --- a/contrib/vpnc +++ b/contrib/vpnc @@ -19,7 +19,7 @@ _vpnc() return 0 ;; --pfs) - COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- $cur ) ) + COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- $cur ) ) return 0 ;; --@(pid-file|script)) diff --git a/contrib/xm b/contrib/xm index b4b4bba8..4e0cfd34 100644 --- a/contrib/xm +++ b/contrib/xm @@ -32,7 +32,7 @@ _xm() vtpm-list vnet-list vnet-create vnet-delete labels addlabel \ rmlabel getlabel dry-run resources makepolicy loadpolicy \ cfgbootpolicy dumppolicy help' - + if [[ $COMP_CWORD -eq 1 ]] ; then COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) else From e7af368e9bf153690b11f2effe58c370cbd8b8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 29 Jul 2009 00:12:54 +0300 Subject: [PATCH 31/69] Use $default instead of -o default. --- contrib/modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/modules b/contrib/modules index 9218d0b8..532cb9b6 100644 --- a/contrib/modules +++ b/contrib/modules @@ -80,5 +80,5 @@ _module () { fi return 0 } -complete -o default -F _module module +complete -F _module $default module } From c86a402077a26fbdbf98ccc99df142f9b517023a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 29 Jul 2009 00:22:14 +0300 Subject: [PATCH 32/69] Load "modules" completion if /etc/profile.d/modules.sh exists even if the "module" alias has not been defined (yet). --- CHANGES | 2 ++ contrib/modules | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 4bee8414..42dd7581 100644 --- a/CHANGES +++ b/CHANGES @@ -96,6 +96,8 @@ bash-completion (1.x) * Associate *.po with poedit, gtranslator, kbabel, and lokalize. * Add xz, xzcat, xzdec, and unxz completion. * Add lzcat and unlzma completion. + * Load "modules" completion if /etc/profile.d/modules.sh exists even if + the "module" alias has not been defined (yet). [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/contrib/modules b/contrib/modules index 532cb9b6..cd267d3f 100644 --- a/contrib/modules +++ b/contrib/modules @@ -17,7 +17,9 @@ # module command is an alias, and the `module avail' command returns # its output as stderr. -type module &>/dev/null && { +# Test for existence of /etc/profile.d/modules.sh too because we may end up +# being sourced before it and thus before the `module' alias has been defined. +have module || [ -f /etc/profile.d/modules.sh ] && { _module_list () { From 91f804f8fb3e220e4e441c1616fa2cb86a16a832 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Wed, 29 Jul 2009 22:09:45 +0200 Subject: [PATCH 33/69] Fixed povray indentation --- contrib/povray | 94 +++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/contrib/povray b/contrib/povray index 10eb68c4..d189def2 100644 --- a/contrib/povray +++ b/contrib/povray @@ -6,55 +6,55 @@ have povray || have xpovray || have spovray && _povray() { - local cur prev povcur pfx oext defoext - defoext=png # default output extension, if cannot be determined FIXME + local cur prev povcur pfx oext defoext + defoext=png # default output extension, if cannot be determined FIXME - COMPREPLY=() - povcur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + COMPREPLY=() + povcur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} - _expand || return 0 + _expand || return 0 - case $povcur in - [-+]I*) - cur="${povcur#[-+]I}" # to confuse _filedir - pfx="${povcur%"$cur"}" - _filedir pov - COMPREPLY=( ${COMPREPLY[@]/#/$pfx} ) - return 0 - ;; - [-+]O*) - # guess what output file type user may want - case $( ( IFS=$'\n'; echo "${COMP_WORDS[*]}" | grep '^[-+]F' ) ) in - [-+]FN) oext=png ;; - [-+]FP) oext=ppm ;; - [-+]F[CT]) oext=tga ;; - *) oext=$defoext ;; - esac - # complete filename corresponding to previously specified +I - COMPREPLY=( $( ( IFS=$'\n'; echo "${COMP_WORDS[*]}" | grep '^[-+]I' ) ) ) - COMPREPLY=( ${COMPREPLY[@]#[-+]I} ) - COMPREPLY=( ${COMPREPLY[@]/%.pov/.$oext} ) - cur="${povcur#[-+]O}" # to confuse _filedir - pfx="${povcur%"$cur"}" - _filedir $oext - COMPREPLY=( ${COMPREPLY[@]/#/$pfx} ) - return 0 - ;; - *.ini\[|*.ini\[*[^]]) # sections in .ini files - cur="${povcur#*\[}" - pfx="${povcur%\["$cur"}" # prefix == filename - [ -r "$pfx" ] || return 0 - COMPREPLY=( $(sed -e 's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/' -e 't' -e 'd' -- "$pfx") ) - # to prevent [bar] expand to nothing. can be done more easily? - COMPREPLY=( "${COMPREPLY[@]/#/$pfx[}" ) - return 0 - ;; - *) - cur="$povcur" - _filedir '?(ini|pov)' - return 0 - ;; - esac + case $povcur in + [-+]I*) + cur="${povcur#[-+]I}" # to confuse _filedir + pfx="${povcur%"$cur"}" + _filedir pov + COMPREPLY=( ${COMPREPLY[@]/#/$pfx} ) + return 0 + ;; + [-+]O*) + # guess what output file type user may want + case $( ( IFS=$'\n'; echo "${COMP_WORDS[*]}" | grep '^[-+]F' ) ) in + [-+]FN) oext=png ;; + [-+]FP) oext=ppm ;; + [-+]F[CT]) oext=tga ;; + *) oext=$defoext ;; + esac + # complete filename corresponding to previously specified +I + COMPREPLY=( $( ( IFS=$'\n'; echo "${COMP_WORDS[*]}" | grep '^[-+]I' ) ) ) + COMPREPLY=( ${COMPREPLY[@]#[-+]I} ) + COMPREPLY=( ${COMPREPLY[@]/%.pov/.$oext} ) + cur="${povcur#[-+]O}" # to confuse _filedir + pfx="${povcur%"$cur"}" + _filedir $oext + COMPREPLY=( ${COMPREPLY[@]/#/$pfx} ) + return 0 + ;; + *.ini\[|*.ini\[*[^]]) # sections in .ini files + cur="${povcur#*\[}" + pfx="${povcur%\["$cur"}" # prefix == filename + [ -r "$pfx" ] || return 0 + COMPREPLY=( $(sed -e 's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/' -e 't' -e 'd' -- "$pfx") ) + # to prevent [bar] expand to nothing. can be done more easily? + COMPREPLY=( "${COMPREPLY[@]/#/$pfx[}" ) + return 0 + ;; + *) + cur="$povcur" + _filedir '?(ini|pov)' + return 0 + ;; + esac } && complete -F _povray $filenames povray xpovray spovray From f8319fa0ea4f339bb6e6edb74eb985513b7408e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 30 Jul 2009 18:35:58 +0300 Subject: [PATCH 34/69] Add *.lzma to xz, unxz and xzcat completions. --- bash_completion | 2 +- contrib/xz | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bash_completion b/bash_completion index 6d2698c0..61142ab4 100644 --- a/bash_completion +++ b/bash_completion @@ -108,7 +108,7 @@ complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip complete -f -X '!*.*' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore complete -f -X '!*.Z' uncompress complete -f -X '!*.lzma' lzcat unlzma -complete -f -X '!*.xz' unxz xzcat +complete -f -X '!*.@(xz|lzma)' unxz xzcat complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' ee complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.bz2|.BZ2|.Z))' gv ggv kghostview diff --git a/contrib/xz b/contrib/xz index fb6089d6..3cb93c92 100644 --- a/contrib/xz +++ b/contrib/xz @@ -24,7 +24,7 @@ _xz() local split=false _split_longopt && split=true - local xspec="*.xz" + local xspec="*.@(xz|lzma)" case "$prev" in -@(!(-*)[dlt]*|-decompress|-list|-test)) @@ -94,6 +94,6 @@ _xzdec() $split && return 0 - _filedir xz + _filedir xz # no lzma support here as of xz 4.999.8beta } && complete -F _xzdec $filenames xzdec From f458bada6c3c541aa91e07c47a36c0f7f1fa1625 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 31 Jul 2009 10:38:59 +0200 Subject: [PATCH 35/69] Call _filedir instead of _filedirs in screen NOTE: Because the `screen' completion doesn't have `-o filenames' in effect, _filedir won't escape spaces in filenames. See also: http://lists.alioth.debian.org/pipermail/bash-completion-devel/2009-July/001766.html --- contrib/screen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/screen b/contrib/screen index a549b763..3117f3d9 100644 --- a/contrib/screen +++ b/contrib/screen @@ -52,7 +52,7 @@ _screen() COMPREPLY=( $( grep ^${cur:-[^#]} /etc/shells ) ) ;; -c) - _filedirs + _filedir return 0 ;; esac From 532f0a0e3fc6f99b07830926e75db398fad8c612 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 31 Jul 2009 12:16:45 +0200 Subject: [PATCH 36/69] Fixed ssh/scp/sftp -F completions - -F (without a space) now also completes. - Fixed error when completion -F with file containing spaces - Call _filedir instead of _filedirs in sftp NOTE: Because the ssh & sftp completions don't have `-o filenames' in effect, _filedir won't escape spaces in filenames. This can be seen in the tests as "expected failures (XFAIL)". See also: http://lists.alioth.debian.org/pipermail/bash-completion-devel/2009-July/001766.html To run the tests: cd test && ./runCompletion ssh.exp scp.exp sftp.exp --- contrib/ssh | 77 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/contrib/ssh b/contrib/ssh index 09fe537f..7dfed79d 100644 --- a/contrib/ssh +++ b/contrib/ssh @@ -29,8 +29,7 @@ _ssh_options() { _ssh() { - local cur prev - local optconfigfile + local cur prev configfile local -a config COMPREPLY=() @@ -75,26 +74,32 @@ _ssh() ;; esac - if [[ "$cur" == -* ]]; then + if [[ "$cur" == -F* ]]; then + cur=${cur#-F} + _filedir + # Prefix completions with '-F' + COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) + cur=-F$cur # Restore cur + elif [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-1 -2 -4 -6 -A -a -C -f -g -K -k -M \ -N -n -q -s -T -t -V -v -X -v -Y -y -b -b -c -D -e -F \ -i -L -l -m -O -o -p -R -S -w' -- $cur ) ) else - # Search COMP_WORDS for '-F configfile' argument + # Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument set -- "${COMP_WORDS[@]}" while [ $# -gt 0 ]; do if [ "${1:0:2}" = -F ]; then if [ ${#1} -gt 2 ]; then - optconfigfile="$(dequote "$1")" + configfile="$(dequote "${1:2}")" else shift - [ "$1" ] && optconfigfile="$(dequote "-F$1")" + [ "$1" ] && configfile="$(dequote "$1")" fi break fi shift done - _known_hosts_real -a $optconfigfile "$cur" + _known_hosts_real -a -F "$configfile" "$cur" if [ $COMP_CWORD -ne 1 ]; then COMPREPLY=( "${COMPREPLY[@]}" $( compgen -c -- $cur ) ) fi @@ -108,8 +113,7 @@ shopt -u hostcomplete && complete -F _ssh ssh slogin autossh # _sftp() { - local cur prev - local optconfigfile + local cur prev configfile COMPREPLY=() cur=`_get_cword` @@ -117,7 +121,7 @@ _sftp() case "$prev" in -@(b|F|P)) - _filedirs + _filedir return 0 ;; -o) @@ -126,7 +130,13 @@ _sftp() ;; esac - if [[ "$cur" == -* ]]; then + if [[ "$cur" == -F* ]]; then + cur=${cur#-F} + _filedir + # Prefix completions with '-F' + COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) + cur=-F$cur # Restore cur + elif [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-1 -C -v -B -b -F -o -P -R -S -s' \ -- $cur ) ) else @@ -135,16 +145,16 @@ _sftp() while [ $# -gt 0 ]; do if [ "${1:0:2}" = -F ]; then if [ ${#1} -gt 2 ]; then - optconfigfile="$(dequote "$1")" + configfile="$(dequote "${1:2}")" else shift - [ "$1" ] && optconfigfile="$(dequote "-F$1")" + [ "$1" ] && configfile="$(dequote "$1")" fi break fi shift done - _known_hosts_real -a $optconfigfile "$cur" + _known_hosts_real -a -F "$configfile" "$cur" fi return 0 @@ -156,8 +166,7 @@ shopt -u hostcomplete && complete -F _sftp sftp # _scp() { - local cur userhost path - local optconfigfile + local configfile cur userhost path prefix COMPREPLY=() cur=`_get_cword ":"` @@ -185,30 +194,34 @@ _scp() return 0 fi - # Search COMP_WORDS for '-F configfile' argument - set -- "${COMP_WORDS[@]}" - while [ $# -gt 0 ]; do - if [ "${1:0:2}" = -F ]; then - if [ ${#1} -gt 2 ]; then - optconfigfile="$(dequote "$1")" - else - shift - [ "$1" ] && optconfigfile="$(dequote "-F$1")" + if [[ "$cur" = -F* ]]; then + cur=${cur#-F} + prefix=-F + else + # Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument + set -- "${COMP_WORDS[@]}" + while [ $# -gt 0 ]; do + if [ "${1:0:2}" = -F ]; then + if [ ${#1} -gt 2 ]; then + configfile="$(dequote "${1:2}")" + else + shift + [ "$1" ] && configfile="$(dequote "$1")" + fi + break fi - break - fi - shift - done - - [[ "$cur" == */* ]] || _known_hosts_real -c -a $optconfigfile "$cur" + shift + done + [[ "$cur" == */* ]] || _known_hosts_real -c -a -F "$configfile" "$cur" + fi # This approach is used instead of _filedir to get a space appended # after local file/dir completions, and $nospace retained for others. local IFS=$'\t\n' COMPREPLY=( "${COMPREPLY[@]}" $( command ls -aF1d $cur* \ 2>/dev/null | sed \ -e "s/[][(){}<>\",:;^&\!$=?\`|\\ ']/\\\\&/g" \ - -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) ) + -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' -e "s/^/$prefix/") ) return 0 } From 567eb378023b1dad539c12507c4e3a4c3f4cd729 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 31 Jul 2009 12:20:51 +0200 Subject: [PATCH 37/69] Reviewed tests s* --- test/_completion_to_review/sbcl-mt.exp | 1 - test/_completion_to_review/sbcl.exp | 1 - test/_completion_to_review/scp.exp | 1 - test/_completion_to_review/screen.exp | 1 - test/_completion_to_review/sed.exp | 1 - test/_completion_to_review/seq.exp | 1 - test/_completion_to_review/service.exp | 1 - test/_completion_to_review/set.exp | 1 - test/_completion_to_review/sha1sum.exp | 1 - test/_completion_to_review/shar.exp | 1 - test/_completion_to_review/sitecopy.exp | 1 - test/_completion_to_review/snownews.exp | 1 - test/_completion_to_review/sort.exp | 1 - test/_completion_to_review/split.exp | 1 - test/_completion_to_review/spovray.exp | 1 - test/_completion_to_review/ssh.exp | 1 - test/_completion_to_review/sshmitm.exp | 1 - test/_completion_to_review/sshow.exp | 1 - test/_completion_to_review/strip.exp | 1 - test/_completion_to_review/sudo.exp | 1 - test/_completion_to_review/svk.exp | 1 - test/_completion_to_review/svn.exp | 1 - test/_completion_to_review/svnadmin.exp | 1 - test/_completion_to_review/svnlook.exp | 1 - test/_completion_to_review/sync_members.exp | 1 - test/_completion_to_review/sysctl.exp | 1 - test/completion/sbcl-mt.exp | 3 + test/completion/sbcl.exp | 3 + test/completion/scp.exp | 3 + test/completion/screen.exp | 3 + test/completion/sed.exp | 3 + test/completion/seq.exp | 3 + test/completion/service.exp | 3 + test/completion/set.exp | 3 + test/completion/sftp.exp | 3 + test/completion/sha1sum.exp | 3 + test/completion/shar.exp | 3 + test/completion/sitecopy.exp | 3 + .../smartctl.exp | 0 test/completion/snownews.exp | 3 + test/completion/sort.exp | 3 + test/completion/split.exp | 3 + test/completion/spovray.exp | 3 + test/completion/ssh.exp | 9 +- test/completion/sshmitm.exp | 3 + test/completion/sshow.exp | 3 + test/completion/strip.exp | 3 + test/completion/sudo.exp | 3 + test/completion/svk.exp | 3 + test/completion/svn.exp | 3 + test/completion/svnadmin.exp | 3 + test/completion/svnlook.exp | 3 + test/completion/sync_members.exp | 3 + test/completion/sysctl.exp | 3 + test/fixtures/scp/config | 6 + test/fixtures/scp/known_hosts | 4 + test/fixtures/scp/spaced conf | 6 + test/fixtures/sftp/config | 6 + test/fixtures/sftp/known_hosts | 4 + test/fixtures/sftp/spaced conf | 6 + test/fixtures/ssh/config | 2 +- test/fixtures/ssh/spaced conf | 6 + test/lib/completions/sbcl-mt.exp | 20 +++ test/lib/completions/sbcl.exp | 20 +++ test/lib/completions/scp.exp | 104 +++++++++++++++ test/lib/completions/screen.exp | 44 +++++++ test/lib/completions/sed.exp | 20 +++ test/lib/completions/seq.exp | 20 +++ test/lib/completions/service.exp | 20 +++ test/lib/completions/set.exp | 20 +++ test/lib/completions/sftp.exp | 77 ++++++++++++ test/lib/completions/sha1sum.exp | 20 +++ test/lib/completions/shar.exp | 20 +++ test/lib/completions/sitecopy.exp | 20 +++ test/lib/completions/smartctl.exp | 20 +++ test/lib/completions/snownews.exp | 20 +++ test/lib/completions/sort.exp | 20 +++ test/lib/completions/split.exp | 20 +++ test/lib/completions/spovray.exp | 20 +++ test/lib/completions/ssh.exp | 52 ++++++-- test/lib/completions/sshmitm.exp | 20 +++ test/lib/completions/sshow.exp | 20 +++ test/lib/completions/strip.exp | 20 +++ test/lib/completions/sudo.exp | 20 +++ test/lib/completions/svk.exp | 20 +++ test/lib/completions/svn.exp | 20 +++ test/lib/completions/svnadmin.exp | 20 +++ test/lib/completions/svnlook.exp | 20 +++ test/lib/completions/sync_members.exp | 20 +++ test/lib/completions/sysctl.exp | 20 +++ test/lib/completions_to_review/sbcl-mt.exp | 26 ---- test/lib/completions_to_review/sbcl.exp | 26 ---- test/lib/completions_to_review/scp.exp | 119 ------------------ test/lib/completions_to_review/screen.exp | 26 ---- test/lib/completions_to_review/sed.exp | 27 ---- test/lib/completions_to_review/seq.exp | 26 ---- test/lib/completions_to_review/service.exp | 26 ---- test/lib/completions_to_review/set.exp | 26 ---- test/lib/completions_to_review/sha1sum.exp | 26 ---- test/lib/completions_to_review/shar.exp | 26 ---- test/lib/completions_to_review/sitecopy.exp | 26 ---- test/lib/completions_to_review/smartctl.exp | 26 ---- test/lib/completions_to_review/snownews.exp | 26 ---- test/lib/completions_to_review/sort.exp | 26 ---- test/lib/completions_to_review/split.exp | 26 ---- test/lib/completions_to_review/spovray.exp | 26 ---- test/lib/completions_to_review/ssh.exp | 75 ----------- test/lib/completions_to_review/sshmitm.exp | 26 ---- test/lib/completions_to_review/sshow.exp | 26 ---- test/lib/completions_to_review/strip.exp | 26 ---- test/lib/completions_to_review/sudo.exp | 25 ---- test/lib/completions_to_review/svk.exp | 26 ---- test/lib/completions_to_review/svn.exp | 41 ------ test/lib/completions_to_review/svnadmin.exp | 26 ---- test/lib/completions_to_review/svnlook.exp | 26 ---- .../completions_to_review/sync_members.exp | 26 ---- test/lib/completions_to_review/sysctl.exp | 29 ----- test/lib/library.exp | 13 +- test/lib/library.sh | 2 +- 119 files changed, 877 insertions(+), 910 deletions(-) delete mode 100644 test/_completion_to_review/sbcl-mt.exp delete mode 100644 test/_completion_to_review/sbcl.exp delete mode 100644 test/_completion_to_review/scp.exp delete mode 100644 test/_completion_to_review/screen.exp delete mode 100644 test/_completion_to_review/sed.exp delete mode 100644 test/_completion_to_review/seq.exp delete mode 100644 test/_completion_to_review/service.exp delete mode 100644 test/_completion_to_review/set.exp delete mode 100644 test/_completion_to_review/sha1sum.exp delete mode 100644 test/_completion_to_review/shar.exp delete mode 100644 test/_completion_to_review/sitecopy.exp delete mode 100644 test/_completion_to_review/snownews.exp delete mode 100644 test/_completion_to_review/sort.exp delete mode 100644 test/_completion_to_review/split.exp delete mode 100644 test/_completion_to_review/spovray.exp delete mode 100644 test/_completion_to_review/ssh.exp delete mode 100644 test/_completion_to_review/sshmitm.exp delete mode 100644 test/_completion_to_review/sshow.exp delete mode 100644 test/_completion_to_review/strip.exp delete mode 100644 test/_completion_to_review/sudo.exp delete mode 100644 test/_completion_to_review/svk.exp delete mode 100644 test/_completion_to_review/svn.exp delete mode 100644 test/_completion_to_review/svnadmin.exp delete mode 100644 test/_completion_to_review/svnlook.exp delete mode 100644 test/_completion_to_review/sync_members.exp delete mode 100644 test/_completion_to_review/sysctl.exp create mode 100644 test/completion/sbcl-mt.exp create mode 100644 test/completion/sbcl.exp create mode 100644 test/completion/scp.exp create mode 100644 test/completion/screen.exp create mode 100644 test/completion/sed.exp create mode 100644 test/completion/seq.exp create mode 100644 test/completion/service.exp create mode 100644 test/completion/set.exp create mode 100644 test/completion/sftp.exp create mode 100644 test/completion/sha1sum.exp create mode 100644 test/completion/shar.exp create mode 100644 test/completion/sitecopy.exp rename test/{_completion_to_review => completion}/smartctl.exp (100%) create mode 100644 test/completion/snownews.exp create mode 100644 test/completion/sort.exp create mode 100644 test/completion/split.exp create mode 100644 test/completion/spovray.exp create mode 100644 test/completion/sshmitm.exp create mode 100644 test/completion/sshow.exp create mode 100644 test/completion/strip.exp create mode 100644 test/completion/sudo.exp create mode 100644 test/completion/svk.exp create mode 100644 test/completion/svn.exp create mode 100644 test/completion/svnadmin.exp create mode 100644 test/completion/svnlook.exp create mode 100644 test/completion/sync_members.exp create mode 100644 test/completion/sysctl.exp create mode 100644 test/fixtures/scp/config create mode 100644 test/fixtures/scp/known_hosts create mode 100644 test/fixtures/scp/spaced conf create mode 100644 test/fixtures/sftp/config create mode 100644 test/fixtures/sftp/known_hosts create mode 100644 test/fixtures/sftp/spaced conf create mode 100644 test/fixtures/ssh/spaced conf create mode 100644 test/lib/completions/sbcl-mt.exp create mode 100644 test/lib/completions/sbcl.exp create mode 100644 test/lib/completions/scp.exp create mode 100644 test/lib/completions/screen.exp create mode 100644 test/lib/completions/sed.exp create mode 100644 test/lib/completions/seq.exp create mode 100644 test/lib/completions/service.exp create mode 100644 test/lib/completions/set.exp create mode 100644 test/lib/completions/sftp.exp create mode 100644 test/lib/completions/sha1sum.exp create mode 100644 test/lib/completions/shar.exp create mode 100644 test/lib/completions/sitecopy.exp create mode 100644 test/lib/completions/smartctl.exp create mode 100644 test/lib/completions/snownews.exp create mode 100644 test/lib/completions/sort.exp create mode 100644 test/lib/completions/split.exp create mode 100644 test/lib/completions/spovray.exp create mode 100644 test/lib/completions/sshmitm.exp create mode 100644 test/lib/completions/sshow.exp create mode 100644 test/lib/completions/strip.exp create mode 100644 test/lib/completions/sudo.exp create mode 100644 test/lib/completions/svk.exp create mode 100644 test/lib/completions/svn.exp create mode 100644 test/lib/completions/svnadmin.exp create mode 100644 test/lib/completions/svnlook.exp create mode 100644 test/lib/completions/sync_members.exp create mode 100644 test/lib/completions/sysctl.exp delete mode 100644 test/lib/completions_to_review/sbcl-mt.exp delete mode 100644 test/lib/completions_to_review/sbcl.exp delete mode 100644 test/lib/completions_to_review/scp.exp delete mode 100644 test/lib/completions_to_review/screen.exp delete mode 100644 test/lib/completions_to_review/sed.exp delete mode 100644 test/lib/completions_to_review/seq.exp delete mode 100644 test/lib/completions_to_review/service.exp delete mode 100644 test/lib/completions_to_review/set.exp delete mode 100644 test/lib/completions_to_review/sha1sum.exp delete mode 100644 test/lib/completions_to_review/shar.exp delete mode 100644 test/lib/completions_to_review/sitecopy.exp delete mode 100644 test/lib/completions_to_review/smartctl.exp delete mode 100644 test/lib/completions_to_review/snownews.exp delete mode 100644 test/lib/completions_to_review/sort.exp delete mode 100644 test/lib/completions_to_review/split.exp delete mode 100644 test/lib/completions_to_review/spovray.exp delete mode 100644 test/lib/completions_to_review/ssh.exp delete mode 100644 test/lib/completions_to_review/sshmitm.exp delete mode 100644 test/lib/completions_to_review/sshow.exp delete mode 100644 test/lib/completions_to_review/strip.exp delete mode 100644 test/lib/completions_to_review/sudo.exp delete mode 100644 test/lib/completions_to_review/svk.exp delete mode 100644 test/lib/completions_to_review/svn.exp delete mode 100644 test/lib/completions_to_review/svnadmin.exp delete mode 100644 test/lib/completions_to_review/svnlook.exp delete mode 100644 test/lib/completions_to_review/sync_members.exp delete mode 100644 test/lib/completions_to_review/sysctl.exp diff --git a/test/_completion_to_review/sbcl-mt.exp b/test/_completion_to_review/sbcl-mt.exp deleted file mode 100644 index 393ec0a9..00000000 --- a/test/_completion_to_review/sbcl-mt.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sbcl-mt.exp" diff --git a/test/_completion_to_review/sbcl.exp b/test/_completion_to_review/sbcl.exp deleted file mode 100644 index d4f06979..00000000 --- a/test/_completion_to_review/sbcl.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sbcl.exp" diff --git a/test/_completion_to_review/scp.exp b/test/_completion_to_review/scp.exp deleted file mode 100644 index 11d354ce..00000000 --- a/test/_completion_to_review/scp.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/scp.exp" diff --git a/test/_completion_to_review/screen.exp b/test/_completion_to_review/screen.exp deleted file mode 100644 index dd8f6a18..00000000 --- a/test/_completion_to_review/screen.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/screen.exp" diff --git a/test/_completion_to_review/sed.exp b/test/_completion_to_review/sed.exp deleted file mode 100644 index e67e44e5..00000000 --- a/test/_completion_to_review/sed.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sed.exp" diff --git a/test/_completion_to_review/seq.exp b/test/_completion_to_review/seq.exp deleted file mode 100644 index adcfca92..00000000 --- a/test/_completion_to_review/seq.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/seq.exp" diff --git a/test/_completion_to_review/service.exp b/test/_completion_to_review/service.exp deleted file mode 100644 index 46156ace..00000000 --- a/test/_completion_to_review/service.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/service.exp" diff --git a/test/_completion_to_review/set.exp b/test/_completion_to_review/set.exp deleted file mode 100644 index 5a1b1d05..00000000 --- a/test/_completion_to_review/set.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/set.exp" diff --git a/test/_completion_to_review/sha1sum.exp b/test/_completion_to_review/sha1sum.exp deleted file mode 100644 index 9250b0b4..00000000 --- a/test/_completion_to_review/sha1sum.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sha1sum.exp" diff --git a/test/_completion_to_review/shar.exp b/test/_completion_to_review/shar.exp deleted file mode 100644 index 693fef92..00000000 --- a/test/_completion_to_review/shar.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/shar.exp" diff --git a/test/_completion_to_review/sitecopy.exp b/test/_completion_to_review/sitecopy.exp deleted file mode 100644 index e923dda8..00000000 --- a/test/_completion_to_review/sitecopy.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sitecopy.exp" diff --git a/test/_completion_to_review/snownews.exp b/test/_completion_to_review/snownews.exp deleted file mode 100644 index a12bdfc1..00000000 --- a/test/_completion_to_review/snownews.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/snownews.exp" diff --git a/test/_completion_to_review/sort.exp b/test/_completion_to_review/sort.exp deleted file mode 100644 index 02e9bdd4..00000000 --- a/test/_completion_to_review/sort.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sort.exp" diff --git a/test/_completion_to_review/split.exp b/test/_completion_to_review/split.exp deleted file mode 100644 index 99e0909c..00000000 --- a/test/_completion_to_review/split.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/split.exp" diff --git a/test/_completion_to_review/spovray.exp b/test/_completion_to_review/spovray.exp deleted file mode 100644 index 78e3fd9c..00000000 --- a/test/_completion_to_review/spovray.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/spovray.exp" diff --git a/test/_completion_to_review/ssh.exp b/test/_completion_to_review/ssh.exp deleted file mode 100644 index f38857de..00000000 --- a/test/_completion_to_review/ssh.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ssh.exp" diff --git a/test/_completion_to_review/sshmitm.exp b/test/_completion_to_review/sshmitm.exp deleted file mode 100644 index 985dbea9..00000000 --- a/test/_completion_to_review/sshmitm.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sshmitm.exp" diff --git a/test/_completion_to_review/sshow.exp b/test/_completion_to_review/sshow.exp deleted file mode 100644 index 6c33d65b..00000000 --- a/test/_completion_to_review/sshow.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sshow.exp" diff --git a/test/_completion_to_review/strip.exp b/test/_completion_to_review/strip.exp deleted file mode 100644 index 29ec81fa..00000000 --- a/test/_completion_to_review/strip.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/strip.exp" diff --git a/test/_completion_to_review/sudo.exp b/test/_completion_to_review/sudo.exp deleted file mode 100644 index 0d1d19e6..00000000 --- a/test/_completion_to_review/sudo.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sudo.exp" diff --git a/test/_completion_to_review/svk.exp b/test/_completion_to_review/svk.exp deleted file mode 100644 index 70b0b1b9..00000000 --- a/test/_completion_to_review/svk.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/svk.exp" diff --git a/test/_completion_to_review/svn.exp b/test/_completion_to_review/svn.exp deleted file mode 100644 index 4252349f..00000000 --- a/test/_completion_to_review/svn.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/svn.exp" diff --git a/test/_completion_to_review/svnadmin.exp b/test/_completion_to_review/svnadmin.exp deleted file mode 100644 index a8790923..00000000 --- a/test/_completion_to_review/svnadmin.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/svnadmin.exp" diff --git a/test/_completion_to_review/svnlook.exp b/test/_completion_to_review/svnlook.exp deleted file mode 100644 index c866811b..00000000 --- a/test/_completion_to_review/svnlook.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/svnlook.exp" diff --git a/test/_completion_to_review/sync_members.exp b/test/_completion_to_review/sync_members.exp deleted file mode 100644 index 30e49fe7..00000000 --- a/test/_completion_to_review/sync_members.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sync_members.exp" diff --git a/test/_completion_to_review/sysctl.exp b/test/_completion_to_review/sysctl.exp deleted file mode 100644 index c1b361a0..00000000 --- a/test/_completion_to_review/sysctl.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/sysctl.exp" diff --git a/test/completion/sbcl-mt.exp b/test/completion/sbcl-mt.exp new file mode 100644 index 00000000..bea489b5 --- /dev/null +++ b/test/completion/sbcl-mt.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sbcl-mt]} { + source "lib/completions/sbcl-mt.exp" +}; # if diff --git a/test/completion/sbcl.exp b/test/completion/sbcl.exp new file mode 100644 index 00000000..d10c6f82 --- /dev/null +++ b/test/completion/sbcl.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sbcl]} { + source "lib/completions/sbcl.exp" +}; # if diff --git a/test/completion/scp.exp b/test/completion/scp.exp new file mode 100644 index 00000000..d100aa61 --- /dev/null +++ b/test/completion/scp.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type scp]} { + source "lib/completions/scp.exp" +}; # if diff --git a/test/completion/screen.exp b/test/completion/screen.exp new file mode 100644 index 00000000..f6009722 --- /dev/null +++ b/test/completion/screen.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type screen]} { + source "lib/completions/screen.exp" +}; # if diff --git a/test/completion/sed.exp b/test/completion/sed.exp new file mode 100644 index 00000000..8a014614 --- /dev/null +++ b/test/completion/sed.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sed]} { + source "lib/completions/sed.exp" +}; # if diff --git a/test/completion/seq.exp b/test/completion/seq.exp new file mode 100644 index 00000000..4dcd7bb9 --- /dev/null +++ b/test/completion/seq.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type seq]} { + source "lib/completions/seq.exp" +}; # if diff --git a/test/completion/service.exp b/test/completion/service.exp new file mode 100644 index 00000000..b4534233 --- /dev/null +++ b/test/completion/service.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type service]} { + source "lib/completions/service.exp" +}; # if diff --git a/test/completion/set.exp b/test/completion/set.exp new file mode 100644 index 00000000..6a882bd2 --- /dev/null +++ b/test/completion/set.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type set]} { + source "lib/completions/set.exp" +}; # if diff --git a/test/completion/sftp.exp b/test/completion/sftp.exp new file mode 100644 index 00000000..4eb27e7a --- /dev/null +++ b/test/completion/sftp.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sftp]} { + source "lib/completions/sftp.exp" +}; # if diff --git a/test/completion/sha1sum.exp b/test/completion/sha1sum.exp new file mode 100644 index 00000000..46a8e8c5 --- /dev/null +++ b/test/completion/sha1sum.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sha1sum]} { + source "lib/completions/sha1sum.exp" +}; # if diff --git a/test/completion/shar.exp b/test/completion/shar.exp new file mode 100644 index 00000000..1c6adb2a --- /dev/null +++ b/test/completion/shar.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type shar]} { + source "lib/completions/shar.exp" +}; # if diff --git a/test/completion/sitecopy.exp b/test/completion/sitecopy.exp new file mode 100644 index 00000000..8b413593 --- /dev/null +++ b/test/completion/sitecopy.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sitecopy]} { + source "lib/completions/sitecopy.exp" +}; # if diff --git a/test/_completion_to_review/smartctl.exp b/test/completion/smartctl.exp similarity index 100% rename from test/_completion_to_review/smartctl.exp rename to test/completion/smartctl.exp diff --git a/test/completion/snownews.exp b/test/completion/snownews.exp new file mode 100644 index 00000000..4ed33e12 --- /dev/null +++ b/test/completion/snownews.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type snownews]} { + source "lib/completions/snownews.exp" +}; # if diff --git a/test/completion/sort.exp b/test/completion/sort.exp new file mode 100644 index 00000000..21c592fd --- /dev/null +++ b/test/completion/sort.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sort]} { + source "lib/completions/sort.exp" +}; # if diff --git a/test/completion/split.exp b/test/completion/split.exp new file mode 100644 index 00000000..fca9bcb0 --- /dev/null +++ b/test/completion/split.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type split]} { + source "lib/completions/split.exp" +}; # if diff --git a/test/completion/spovray.exp b/test/completion/spovray.exp new file mode 100644 index 00000000..cceac7da --- /dev/null +++ b/test/completion/spovray.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type spovray]} { + source "lib/completions/spovray.exp" +}; # if diff --git a/test/completion/ssh.exp b/test/completion/ssh.exp index 5b14ce25..f95761b0 100644 --- a/test/completion/ssh.exp +++ b/test/completion/ssh.exp @@ -1,6 +1,3 @@ -source "lib/completions/ssh.exp" - -# TODO: Dynamic loading of completions. After the tests have the first time and -# real completion is installed, the tests can be run a second time. -# -# source "lib/completions/ssh.exp" +if {[assert_bash_type {ssh}]} { + source "lib/completions/ssh.exp" +}; # if diff --git a/test/completion/sshmitm.exp b/test/completion/sshmitm.exp new file mode 100644 index 00000000..e6dc76a4 --- /dev/null +++ b/test/completion/sshmitm.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sshmitm]} { + source "lib/completions/sshmitm.exp" +}; # if diff --git a/test/completion/sshow.exp b/test/completion/sshow.exp new file mode 100644 index 00000000..b0c68da6 --- /dev/null +++ b/test/completion/sshow.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sshow]} { + source "lib/completions/sshow.exp" +}; # if diff --git a/test/completion/strip.exp b/test/completion/strip.exp new file mode 100644 index 00000000..4ce38360 --- /dev/null +++ b/test/completion/strip.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type strip]} { + source "lib/completions/strip.exp" +}; # if diff --git a/test/completion/sudo.exp b/test/completion/sudo.exp new file mode 100644 index 00000000..d4369ef5 --- /dev/null +++ b/test/completion/sudo.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type {sudo}]} { + source "lib/completions/sudo.exp" +}; # if diff --git a/test/completion/svk.exp b/test/completion/svk.exp new file mode 100644 index 00000000..29058146 --- /dev/null +++ b/test/completion/svk.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type svk]} { + source "lib/completions/svk.exp" +}; # if diff --git a/test/completion/svn.exp b/test/completion/svn.exp new file mode 100644 index 00000000..61aee593 --- /dev/null +++ b/test/completion/svn.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type svn]} { + source "lib/completions/svn.exp" +}; # if diff --git a/test/completion/svnadmin.exp b/test/completion/svnadmin.exp new file mode 100644 index 00000000..83e042a5 --- /dev/null +++ b/test/completion/svnadmin.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type svnadmin]} { + source "lib/completions/svnadmin.exp" +}; # if diff --git a/test/completion/svnlook.exp b/test/completion/svnlook.exp new file mode 100644 index 00000000..1e003e53 --- /dev/null +++ b/test/completion/svnlook.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type svnlook]} { + source "lib/completions/svnlook.exp" +}; # if diff --git a/test/completion/sync_members.exp b/test/completion/sync_members.exp new file mode 100644 index 00000000..23277128 --- /dev/null +++ b/test/completion/sync_members.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sync_members]} { + source "lib/completions/sync_members.exp" +}; # if diff --git a/test/completion/sysctl.exp b/test/completion/sysctl.exp new file mode 100644 index 00000000..debb8d62 --- /dev/null +++ b/test/completion/sysctl.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type sysctl]} { + source "lib/completions/sysctl.exp" +}; # if diff --git a/test/fixtures/scp/config b/test/fixtures/scp/config new file mode 100644 index 00000000..fea6620e --- /dev/null +++ b/test/fixtures/scp/config @@ -0,0 +1,6 @@ +UserKnownHostsFile known_hosts + + # Unindented +Host gee + # Indented, multiple hosts + HostName hus ike diff --git a/test/fixtures/scp/known_hosts b/test/fixtures/scp/known_hosts new file mode 100644 index 00000000..d54a04d0 --- /dev/null +++ b/test/fixtures/scp/known_hosts @@ -0,0 +1,4 @@ +|1|abc +|1|def +doo +ike ssh-rsa qwerty1234/Qwerty+1234== diff --git a/test/fixtures/scp/spaced conf b/test/fixtures/scp/spaced conf new file mode 100644 index 00000000..7ad64bc8 --- /dev/null +++ b/test/fixtures/scp/spaced conf @@ -0,0 +1,6 @@ + UserKnownHostsFile known_hosts + + # Unindented +Host gee jar + # Indented, multiple hosts + HostName hus diff --git a/test/fixtures/sftp/config b/test/fixtures/sftp/config new file mode 100644 index 00000000..fea6620e --- /dev/null +++ b/test/fixtures/sftp/config @@ -0,0 +1,6 @@ +UserKnownHostsFile known_hosts + + # Unindented +Host gee + # Indented, multiple hosts + HostName hus ike diff --git a/test/fixtures/sftp/known_hosts b/test/fixtures/sftp/known_hosts new file mode 100644 index 00000000..d54a04d0 --- /dev/null +++ b/test/fixtures/sftp/known_hosts @@ -0,0 +1,4 @@ +|1|abc +|1|def +doo +ike ssh-rsa qwerty1234/Qwerty+1234== diff --git a/test/fixtures/sftp/spaced conf b/test/fixtures/sftp/spaced conf new file mode 100644 index 00000000..7ad64bc8 --- /dev/null +++ b/test/fixtures/sftp/spaced conf @@ -0,0 +1,6 @@ + UserKnownHostsFile known_hosts + + # Unindented +Host gee jar + # Indented, multiple hosts + HostName hus diff --git a/test/fixtures/ssh/config b/test/fixtures/ssh/config index ab30ce41..806f405c 100644 --- a/test/fixtures/ssh/config +++ b/test/fixtures/ssh/config @@ -1 +1 @@ -UserKnownHostsFile fixtures/ssh/known_hosts +UserKnownHostsFile known_hosts diff --git a/test/fixtures/ssh/spaced conf b/test/fixtures/ssh/spaced conf new file mode 100644 index 00000000..7ad64bc8 --- /dev/null +++ b/test/fixtures/ssh/spaced conf @@ -0,0 +1,6 @@ + UserKnownHostsFile known_hosts + + # Unindented +Host gee jar + # Indented, multiple hosts + HostName hus diff --git a/test/lib/completions/sbcl-mt.exp b/test/lib/completions/sbcl-mt.exp new file mode 100644 index 00000000..905a62ca --- /dev/null +++ b/test/lib/completions/sbcl-mt.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sbcl-mt " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sbcl.exp b/test/lib/completions/sbcl.exp new file mode 100644 index 00000000..27633320 --- /dev/null +++ b/test/lib/completions/sbcl.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sbcl " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/scp.exp b/test/lib/completions/scp.exp new file mode 100644 index 00000000..d16741a2 --- /dev/null +++ b/test/lib/completions/scp.exp @@ -0,0 +1,104 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified { + /BASH_LINENO=/d + /BASH_SOURCE=/d + /OLDPWD=/d + } +}; # teardown() + + +setup + + +set test "Tab should complete remote pwd" +set host bash_completion + + # Retrieving home directory (host_pwd) from ssh-host `bash_completion' + # yields error? +if { + [catch { + exec -- ssh -o "Batchmode yes" -o "ConnectTimeout 1" $host pwd 2>> /dev/null + } host_pwd] +} { + # Yes, retrieving pwd from ssh yields error; reset `host_pwd' + # Indicate host pwd is unknown and test is unsupported + # NOTE: To support this test, set the hostname "bash_completion" + # in `$HOME/.ssh/config' or `/etc/ssh_config' + set host_pwd "" + unsupported $test +}; # if + + + # Try completion +set cmd "scp $host:" +send "$cmd\t" +sync_after_tab +expect { + -re "^$cmd$host_pwd.*$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } +}; # expect + + +sync_after_int + + +set test "Tab should complete known-hosts" + + # Build string list of expected completions + # Get hostnames and give them a colon (:) suffix + # Hosts `gee' and `hus' are defined in ./fixtures/scp/config + # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts +set expected {} +foreach host [get_hosts] { + lappend expected "$host:" +}; # foreach +lappend expected doo: gee: hus: ike: + # Append local filenames +lappend expected config known_hosts "spaced\\\\ \\\\ conf" +set dir fixtures/scp +assert_complete_dir $expected "scp -F config " $dir + + +sync_after_int + + +set test "-F without space shouldn't error" + # Try completion +set cmd "scp -F" +send "$cmd\t " +expect { + -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } + -re "^$cmd\r\n.*\r\n/@" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect + + +sync_after_int + + +set test "Config file containing space should work" + # Build string list of expected completions + # Get hostnames and give them a colon (:) suffix +set expected {} +foreach host [get_hosts] { + lappend expected "$host:" +}; # foreach + # Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf" + # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts +lappend expected doo: gee: hus: ike: jar: + # Append local filenames +lappend expected config known_hosts "spaced\\\\ \\\\ conf" +set dir fixtures/scp +assert_complete_dir $expected "scp -F 'spaced conf' " $dir + + +sync_after_int + + +teardown diff --git a/test/lib/completions/screen.exp b/test/lib/completions/screen.exp new file mode 100644 index 00000000..5d018714 --- /dev/null +++ b/test/lib/completions/screen.exp @@ -0,0 +1,44 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +assert_complete_any "screen -" + + +sync_after_int + + +set test "-c should complete files/dirs" +set dir fixture1 +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "screen -c " +set expected {bar {bar bar.d} foo {foo.d}} +send "$cmd\t" +expect -ex "$cmd" +expect { + -re "bar\\s+bar\\\\ bar.d\\s+foo\\s+foo.d" { pass "$test" } + # _filedir works only if `-o filenames' is in effect, which isn't the + # case for `screen' + -re "bar\\s+bar bar.d\\s+foo\\s+foo.d" { xfail "$test" } + -re $prompt { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect +sync_after_int $prompt +assert_bash_exec "cd \$TESTDIR" + + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sed.exp b/test/lib/completions/sed.exp new file mode 100644 index 00000000..05841070 --- /dev/null +++ b/test/lib/completions/sed.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sed --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/seq.exp b/test/lib/completions/seq.exp new file mode 100644 index 00000000..b5333ef9 --- /dev/null +++ b/test/lib/completions/seq.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "seq --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/service.exp b/test/lib/completions/service.exp new file mode 100644 index 00000000..917c5dcb --- /dev/null +++ b/test/lib/completions/service.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "service " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/set.exp b/test/lib/completions/set.exp new file mode 100644 index 00000000..2b2d40e9 --- /dev/null +++ b/test/lib/completions/set.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "set no" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sftp.exp b/test/lib/completions/sftp.exp new file mode 100644 index 00000000..7cd89c0c --- /dev/null +++ b/test/lib/completions/sftp.exp @@ -0,0 +1,77 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified { + /BASH_LINENO=/d + /BASH_SOURCE=/d + /OLDPWD=/d + } +}; # teardown() + + +setup + + + # Build string list of expected completions +set expected [get_hosts] + # Hosts `gee' and `hus' are defined in ./fixtures/sftp/config + # Hosts `doo' and `ike' are defined in ./fixtures/sftp/known_hosts +lappend expected doo gee hus ike +set dir fixtures/scp +assert_complete_dir $expected "sftp -F config " $dir + + +sync_after_int + + +set test "-F without space shouldn't error" + # Try completion +set cmd "sftp -F" +send "$cmd\t " +expect { + -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } + -re "^$cmd\r\n.*\r\n/@" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect + + +sync_after_int + + + # Build string list of expected completions + # Get hostnames and give them a colon (:) suffix +set expected [get_hosts] + # Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf" + # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts +lappend expected doo gee hus ike jar +set dir fixtures/scp +assert_complete_dir $expected "sftp -F 'spaced conf' " $dir + + +sync_after_int + + +set test "-F should complete filename" +set dir fixtures/sftp +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "ssh -Fsp" +send "$cmd\t" +expect -ex "$cmd" +expect { + -ex "aced\\ \\ conf" { pass "$test" } + # _filedir works only if `-o filenames' is in effect, which isn't the + # case for `sftp' + -re "aced conf" { xfail "$test" } + -re $prompt { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect +sync_after_int $prompt +assert_bash_exec "cd \$TESTDIR" + + +teardown diff --git a/test/lib/completions/sha1sum.exp b/test/lib/completions/sha1sum.exp new file mode 100644 index 00000000..17519087 --- /dev/null +++ b/test/lib/completions/sha1sum.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sha1sum --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/shar.exp b/test/lib/completions/shar.exp new file mode 100644 index 00000000..7ace9d6e --- /dev/null +++ b/test/lib/completions/shar.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "shar --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sitecopy.exp b/test/lib/completions/sitecopy.exp new file mode 100644 index 00000000..49b78918 --- /dev/null +++ b/test/lib/completions/sitecopy.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sitecopy --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/smartctl.exp b/test/lib/completions/smartctl.exp new file mode 100644 index 00000000..a9eeb956 --- /dev/null +++ b/test/lib/completions/smartctl.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "smartctl --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/snownews.exp b/test/lib/completions/snownews.exp new file mode 100644 index 00000000..7502e587 --- /dev/null +++ b/test/lib/completions/snownews.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "snownews --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sort.exp b/test/lib/completions/sort.exp new file mode 100644 index 00000000..20516cc8 --- /dev/null +++ b/test/lib/completions/sort.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sort --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/split.exp b/test/lib/completions/split.exp new file mode 100644 index 00000000..249ff9bc --- /dev/null +++ b/test/lib/completions/split.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "split --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/spovray.exp b/test/lib/completions/spovray.exp new file mode 100644 index 00000000..30d81853 --- /dev/null +++ b/test/lib/completions/spovray.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "spovray " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ssh.exp b/test/lib/completions/ssh.exp index 81b88e4b..6afd3397 100644 --- a/test/lib/completions/ssh.exp +++ b/test/lib/completions/ssh.exp @@ -4,23 +4,32 @@ proc setup {} { proc teardown {} { - assert_env_unmodified + assert_env_unmodified { + /BASH_LINENO=/d + /BASH_SOURCE=/d + /OLDPWD=/d + } }; # teardown() setup -set test "Tab should complete both commands and hostnames" +set test "Tab should complete both commands and hostname" # Try completion -set cmd "ssh -F fixtures/ssh/config ls" +set dir fixtures/ssh +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "ssh -F config ls" send "$cmd\t" -set expected "^$cmd\r\n.*ls.*ls_known_host.*\r\n/@$cmd$" +set expected "^$cmd\r\n.*ls.*ls_known_host.*\r\n$prompt$cmd$" expect { -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } + -re $prompt { unresolved "$test at prompt" } default { unresolved "$test" } }; # expect +sync_after_int $prompt +assert_bash_exec "cd \$TESTDIR" sync_after_int @@ -33,7 +42,7 @@ send "$cmd\t " set expected "^$cmd $" expect { -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } - -re $expected { pass "$test" } + -re "^$cmd\r\n.*\r\n/@" { pass "$test" } -re /@ { unresolved "$test at prompt" } default { unresolved "$test" } }; # expect @@ -50,10 +59,13 @@ send "$cmd\t" expect -ex "$cmd" expect { -timeout 1 - # In case multiple commands `bas*' are completed + # In case multiple commands `bas*' - besides `bash' - are completed -re "^\r\n.*bash.*\r\n/@$cmd$" { fail "$test" } # In case the single command `bash' is completed -re "h $" { fail "$test" } + # In case the hostname `bash_completion' is completed. + # See `scp' tests in `lib/completions/scp.exp' + -re "h_completion $" { pass "$test" } -re ".+" { unresolved "$test" } timeout { pass "$test" } }; # expect @@ -62,8 +74,30 @@ expect { sync_after_int -set test "Tab should complete partial hostname" -assert_complete_partial [get_hosts] "ssh" +set test "First argument should complete partial hostname" +assert_complete_partial [get_hosts] ssh + + +sync_after_int + + +set test "-F should complete filename" +set dir fixtures/ssh +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "ssh -Fsp" +send "$cmd\t" +expect -ex "$cmd" +expect { + -ex "aced\\ \\ conf" { pass "$test" } + # _filedir works only if `-o filenames' is in effect, which isn't the + # case for `ssh' + -re "aced conf" { xfail "$test" } + -re $prompt { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect +sync_after_int $prompt +assert_bash_exec "cd \$TESTDIR" sync_after_int diff --git a/test/lib/completions/sshmitm.exp b/test/lib/completions/sshmitm.exp new file mode 100644 index 00000000..b8f8a2c9 --- /dev/null +++ b/test/lib/completions/sshmitm.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sshmitm -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sshow.exp b/test/lib/completions/sshow.exp new file mode 100644 index 00000000..36a6cc2c --- /dev/null +++ b/test/lib/completions/sshow.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sshow -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/strip.exp b/test/lib/completions/strip.exp new file mode 100644 index 00000000..46d9f362 --- /dev/null +++ b/test/lib/completions/strip.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "strip --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sudo.exp b/test/lib/completions/sudo.exp new file mode 100644 index 00000000..3dc98da3 --- /dev/null +++ b/test/lib/completions/sudo.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete "fixture1/foo.d/" "sudo cd fixture1/fo" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/svk.exp b/test/lib/completions/svk.exp new file mode 100644 index 00000000..a08674dc --- /dev/null +++ b/test/lib/completions/svk.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "svk " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/svn.exp b/test/lib/completions/svn.exp new file mode 100644 index 00000000..fe40d6f7 --- /dev/null +++ b/test/lib/completions/svn.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "svn " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/svnadmin.exp b/test/lib/completions/svnadmin.exp new file mode 100644 index 00000000..35e07021 --- /dev/null +++ b/test/lib/completions/svnadmin.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "svnadmin " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/svnlook.exp b/test/lib/completions/svnlook.exp new file mode 100644 index 00000000..33b67052 --- /dev/null +++ b/test/lib/completions/svnlook.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "svnlook " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sync_members.exp b/test/lib/completions/sync_members.exp new file mode 100644 index 00000000..4cb84ad8 --- /dev/null +++ b/test/lib/completions/sync_members.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sync_members --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/sysctl.exp b/test/lib/completions/sysctl.exp new file mode 100644 index 00000000..cd7e7e3d --- /dev/null +++ b/test/lib/completions/sysctl.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sysctl fs" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/sbcl-mt.exp b/test/lib/completions_to_review/sbcl-mt.exp deleted file mode 100644 index 51e15ba5..00000000 --- a/test/lib/completions_to_review/sbcl-mt.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sbcl-mt " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sbcl.exp b/test/lib/completions_to_review/sbcl.exp deleted file mode 100644 index 9f5561a6..00000000 --- a/test/lib/completions_to_review/sbcl.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sbcl " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/scp.exp b/test/lib/completions_to_review/scp.exp deleted file mode 100644 index d11af006..00000000 --- a/test/lib/completions_to_review/scp.exp +++ /dev/null @@ -1,119 +0,0 @@ -proc setup {} { - set test setup - set cmd "cd fixtures/scp" - send "$cmd\r" - expect -re "^$cmd\r\n/fixtures/scp/@" -}; # setup() - - -proc teardown {} { - set test teardown - set cmd "cd ../.." - send "$cmd\r" - expect -re "^$cmd\r\n/@" -}; # teardown() - - -setup - - -set test "Tab should complete remote pwd" - - # Retrieving `host_pwd' from ssh-host `bash_completion_lib' yields error? - # NOTE: The host should be set in e.g. .ssh/config or /etc/ssh_config -if { - [catch { - exec -- ssh -o "Batchmode yes" bash_completion_lib pwd 2>> /dev/null - } host_pwd] -} { - # Yes, retrieving pwd from ssh yields error; reset `host_pwd' - set host_pwd "" -} - - # Try completion -set cmd "scp bash_completion_lib:" -send "$cmd\t" -sync_after_tab -expect { - -re "^$cmd$host_pwd.*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } -}; # expect - - -sleep .5 -sync_after_int - - -set test "Tab should complete scp known-hosts" - - # Build string list of completions, separated by regexp whitespace marker (\s+). - # Example string: comp1\s+comp2\s+comp3 - - # Get hostnames -set comps [exec bash -c "compgen -A hostname"] - # Hosts `gee' and `hus' are defined in ./fixtures/scp/config - # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts -lappend comps doo gee hus ike - # Append filenames `config' and `known_hosts' -lappend comps config known_hosts "spaced\\\\ \\\\ conf" -set comps [lsort -ascii $comps] -set comps [join $comps ":{0,1}\\s+"] - # Try completion -set cmd "scp -F config " -send "$cmd\t" -set expected "^${cmd}\r\n$comps:{0,1}\\s*/fixtures/scp/@$cmd$" -expect { - -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -sync_after_int - - -set test "-F without space shouldn't error" - # Try completion -set cmd "scp -F" -send "$cmd\t " -set expected "^$cmd $" -expect { - -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } - -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -sync_after_int - - -set test "Config file containing space should work" - - # Build string list of completions, separated by regexp whitespace marker (\s+). - # Example string: comp1\s+comp2\s+comp3 - - # Get hostnames -set comps [exec bash -c "compgen -A hostname"] - # Hosts `gee' and `hus' are defined in ./fixtures/scp/config - # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts -lappend comps doo gee hus ike - # Append filenames `config' and `known_hosts' -lappend comps config known_hosts "spaced\\\\ \\\\ conf" -set comps [lsort -ascii $comps] -set comps [join $comps ":{0,1}\\s+"] - # Try completion -set cmd "scp -F 'spaced conf' " -send "$cmd\t" -set expected "^${cmd}\r\n$comps:{0,1}\\s*/fixtures/scp/@$cmd$" -expect { - -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/screen.exp b/test/lib/completions_to_review/screen.exp deleted file mode 100644 index ee273268..00000000 --- a/test/lib/completions_to_review/screen.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "screen -s /" -send "$cmd\t" -expect { - -re "^${cmd}(grep: /etc/shells: No such file or directory|)\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sed.exp b/test/lib/completions_to_review/sed.exp deleted file mode 100644 index 91be8add..00000000 --- a/test/lib/completions_to_review/sed.exp +++ /dev/null @@ -1,27 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sed " -send "$cmd\t" -sync_after_tab -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/seq.exp b/test/lib/completions_to_review/seq.exp deleted file mode 100644 index c2bda8b5..00000000 --- a/test/lib/completions_to_review/seq.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "seq " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/service.exp b/test/lib/completions_to_review/service.exp deleted file mode 100644 index 3095725e..00000000 --- a/test/lib/completions_to_review/service.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should show completions" - # Try completion -set cmd "service " -send "$cmd\t" -expect { - -re "$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/set.exp b/test/lib/completions_to_review/set.exp deleted file mode 100644 index 39e70b02..00000000 --- a/test/lib/completions_to_review/set.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "set no" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sha1sum.exp b/test/lib/completions_to_review/sha1sum.exp deleted file mode 100644 index 6f8bb60b..00000000 --- a/test/lib/completions_to_review/sha1sum.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sha1sum " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/shar.exp b/test/lib/completions_to_review/shar.exp deleted file mode 100644 index 08ef458f..00000000 --- a/test/lib/completions_to_review/shar.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "shar " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sitecopy.exp b/test/lib/completions_to_review/sitecopy.exp deleted file mode 100644 index 8d0d2afc..00000000 --- a/test/lib/completions_to_review/sitecopy.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sitecopy " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/smartctl.exp b/test/lib/completions_to_review/smartctl.exp deleted file mode 100644 index e45b9f65..00000000 --- a/test/lib/completions_to_review/smartctl.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "smartctl --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/snownews.exp b/test/lib/completions_to_review/snownews.exp deleted file mode 100644 index 3b7eccfc..00000000 --- a/test/lib/completions_to_review/snownews.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "snownews --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sort.exp b/test/lib/completions_to_review/sort.exp deleted file mode 100644 index 6db7aa61..00000000 --- a/test/lib/completions_to_review/sort.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sort " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/split.exp b/test/lib/completions_to_review/split.exp deleted file mode 100644 index f9077943..00000000 --- a/test/lib/completions_to_review/split.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "split " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/spovray.exp b/test/lib/completions_to_review/spovray.exp deleted file mode 100644 index 85f59232..00000000 --- a/test/lib/completions_to_review/spovray.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "spovray " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ssh.exp b/test/lib/completions_to_review/ssh.exp deleted file mode 100644 index 5b98d878..00000000 --- a/test/lib/completions_to_review/ssh.exp +++ /dev/null @@ -1,75 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete ssh known-hosts" - # Build string list of hostnames, separated by regexp whitespace marker (\s+). - # Example string: host1\s+host2\s+host3 -set hosts [exec bash -c "compgen -A hostname"] - # Hosts `gee' and `hus' are defined in ./fixtures/ssh/config - # Hosts `doo' and `ike' are defined in ./fixtures/ssh/known_hosts -lappend hosts doo gee hus ike -set hosts [lsort -ascii $hosts] -set hosts [join $hosts "\\s+"] - # Try completion -set cmd "ssh -F fixtures/ssh/config " -send "$cmd\t" -set expected "^$cmd\r\n$hosts\r\n/@$cmd$" -expect { - -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -sync_after_int - - -set test "-F without space shouldn't error" - # Try completion -set cmd "ssh -F" -send "$cmd\t " -set expected "^$cmd $" -expect { - -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } - -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -sync_after_int - - -set test "Config file containing space should work" - # Build string list of hostnames, separated by regexp whitespace marker (\s+). - # Example string: host1\s+host2\s+host3 -set hosts [exec bash -c "compgen -A hostname"] - # Hosts `gee' and `hus' are defined in ./fixtures/ssh/config - # Hosts `doo' and `ike' are defined in ./fixtures/ssh/known_hosts - # Host `two' is defined in ./fixtures/ssh/known_hosts2 -lappend hosts doo gee hus ike two -set hosts [lsort -ascii $hosts] -set hosts [join $hosts "\\s+"] - # Try completion -set cmd "ssh -F 'fixtures/ssh/spaced conf' " -send "$cmd\t" -set expected "^$cmd\r\n$hosts\r\n/@$cmd$" -expect { - -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sshmitm.exp b/test/lib/completions_to_review/sshmitm.exp deleted file mode 100644 index 6fbfa487..00000000 --- a/test/lib/completions_to_review/sshmitm.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sshmitm -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sshow.exp b/test/lib/completions_to_review/sshow.exp deleted file mode 100644 index 683a9242..00000000 --- a/test/lib/completions_to_review/sshow.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sshow -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/strip.exp b/test/lib/completions_to_review/strip.exp deleted file mode 100644 index ad73514f..00000000 --- a/test/lib/completions_to_review/strip.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "strip " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sudo.exp b/test/lib/completions_to_review/sudo.exp deleted file mode 100644 index e0799fb3..00000000 --- a/test/lib/completions_to_review/sudo.exp +++ /dev/null @@ -1,25 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sudo cd fixture1/fo" -send "$cmd\t" -expect { - -re "^sudo cd fixture1/foo.d/$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/svk.exp b/test/lib/completions_to_review/svk.exp deleted file mode 100644 index c4bd3e71..00000000 --- a/test/lib/completions_to_review/svk.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "svk " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/svn.exp b/test/lib/completions_to_review/svn.exp deleted file mode 100644 index bef9c050..00000000 --- a/test/lib/completions_to_review/svn.exp +++ /dev/null @@ -1,41 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "svn " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -set test "Completing --editor-cmd should invoke _command" - # Try completion -set cmd "svn commit --editor-cmd vim" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/svnadmin.exp b/test/lib/completions_to_review/svnadmin.exp deleted file mode 100644 index fabf5c91..00000000 --- a/test/lib/completions_to_review/svnadmin.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "svnadmin " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/svnlook.exp b/test/lib/completions_to_review/svnlook.exp deleted file mode 100644 index ab4adf39..00000000 --- a/test/lib/completions_to_review/svnlook.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "svnlook " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sync_members.exp b/test/lib/completions_to_review/sync_members.exp deleted file mode 100644 index 370709a4..00000000 --- a/test/lib/completions_to_review/sync_members.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sync_members --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/sysctl.exp b/test/lib/completions_to_review/sysctl.exp deleted file mode 100644 index 6793cf2c..00000000 --- a/test/lib/completions_to_review/sysctl.exp +++ /dev/null @@ -1,29 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "sysctl " -send "$cmd\t" - # NOTE: Wait in case `sysctl' returns nothing, so that "^$cdm.*$" doesn't match - # too early -- before comp_install has finished -sleep 1 -expect { - -re "^$cmd\.*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/library.exp b/test/lib/library.exp index 968c4323..3299ccba 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -65,8 +65,12 @@ proc assert_complete {expected cmd {test ""} {prompt /@} {size 20}} { send "$cmd\t" if {[llength $expected] == 1} { expect -ex "$cmd" - # Assume second word is word to complete on. - set cur [lindex [split $cmd] 1] + set cmds [split $cmd] + set cur ""; # Default to empty word to complete on + if {[llength $cmds] > 1} { + # Assume last word of `$cmd' is word to complete on. + set cur [lindex $cmds [expr [llength $cmds] - 1]] + }; # if # Remove second word from beginning of single item $expected if {[string first $cur $expected] == 0} { set expected [string range $expected [string length $cur] end] @@ -181,7 +185,7 @@ proc assert_complete_partial {expected cmd {partial ""} {test ""} {prompt /@} {s # # Replace `COMP_PATH=.*' with `COMP_PATH=PATH' # assert_env_unmodified {s/COMP_PATH=.*/COMP_PATH=PATH/} # -# # Remove lines containing with `OLDPWD=' +# # Remove lines containing `OLDPWD=' # assert_env_unmodified {/OLDPWD=/d} # # @param string $file Filename to generate environment save file from. See @@ -277,7 +281,7 @@ proc get_hosts {} { type avahi-browse >&/dev/null && [ -n "$(pidof avahi-daemon)" ] avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u }] - if {[llength $avahi_hosts] > 1} { + if {[llength $avahi_hosts] > 0} { lappend hosts $avahi_hosts }; # if return $hosts @@ -342,7 +346,6 @@ proc match_items {items test {size 20}} { # Get real command. # - arg: $1 Command -# - stdout: Filename of command in PATH with possible symbolic links resolved. # - return: Command found, empty string if not found proc realcommand {cmd} { set result "" diff --git a/test/lib/library.sh b/test/lib/library.sh index e9b4d43a..df683c6d 100644 --- a/test/lib/library.sh +++ b/test/lib/library.sh @@ -10,7 +10,7 @@ # @param $1 Additional sed script diff_env() { diff "$1" "$2" | sed -e " - /^[0-9]\+[acd]/d # Remove diff line indicators + /^[0-9,]\+[acd]/d # Remove diff line indicators /---/d # Remove diff block separators /[<>] _=/d # Remove underscore variable /[<>] PPID=/d # Remove PPID bash variable From bcd33375cac35d190fc9c15e690ab1e452282e45 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 31 Jul 2009 22:18:12 +0200 Subject: [PATCH 38/69] Reviewed tests t* --- test/_completion_to_review/tac.exp | 1 - test/_completion_to_review/tail.exp | 1 - test/_completion_to_review/tar.exp | 1 - test/_completion_to_review/tcpkill.exp | 1 - test/_completion_to_review/tcpnice.exp | 1 - test/_completion_to_review/tee.exp | 1 - test/_completion_to_review/texindex.exp | 1 - test/_completion_to_review/time.exp | 1 - test/_completion_to_review/touch.exp | 1 - test/_completion_to_review/tr.exp | 1 - test/completion/tac.exp | 3 +++ test/completion/tail.exp | 3 +++ test/completion/tar.exp | 3 +++ test/completion/tcpkill.exp | 3 +++ test/completion/tcpnice.exp | 3 +++ test/completion/tee.exp | 3 +++ test/completion/texindex.exp | 3 +++ test/completion/tightvncviewer.exp | 2 +- test/completion/time.exp | 3 +++ test/completion/touch.exp | 3 +++ test/completion/tr.exp | 3 +++ test/lib/completions/tac.exp | 20 ++++++++++++++++ test/lib/completions/tail.exp | 20 ++++++++++++++++ test/lib/completions/tar.exp | 20 ++++++++++++++++ test/lib/completions/tcpkill.exp | 20 ++++++++++++++++ test/lib/completions/tcpnice.exp | 20 ++++++++++++++++ test/lib/completions/tee.exp | 20 ++++++++++++++++ test/lib/completions/texindex.exp | 20 ++++++++++++++++ test/lib/completions/tightvncviewer.exp | 10 +------- test/lib/completions/time.exp | 20 ++++++++++++++++ test/lib/completions/touch.exp | 20 ++++++++++++++++ test/lib/completions/tr.exp | 20 ++++++++++++++++ test/lib/completions_to_review/tac.exp | 26 --------------------- test/lib/completions_to_review/tail.exp | 26 --------------------- test/lib/completions_to_review/tar.exp | 26 --------------------- test/lib/completions_to_review/tcpkill.exp | 26 --------------------- test/lib/completions_to_review/tcpnice.exp | 26 --------------------- test/lib/completions_to_review/tee.exp | 26 --------------------- test/lib/completions_to_review/texindex.exp | 26 --------------------- test/lib/completions_to_review/time.exp | 26 --------------------- test/lib/completions_to_review/touch.exp | 26 --------------------- test/lib/completions_to_review/tr.exp | 26 --------------------- 42 files changed, 232 insertions(+), 280 deletions(-) delete mode 100644 test/_completion_to_review/tac.exp delete mode 100644 test/_completion_to_review/tail.exp delete mode 100644 test/_completion_to_review/tar.exp delete mode 100644 test/_completion_to_review/tcpkill.exp delete mode 100644 test/_completion_to_review/tcpnice.exp delete mode 100644 test/_completion_to_review/tee.exp delete mode 100644 test/_completion_to_review/texindex.exp delete mode 100644 test/_completion_to_review/time.exp delete mode 100644 test/_completion_to_review/touch.exp delete mode 100644 test/_completion_to_review/tr.exp create mode 100644 test/completion/tac.exp create mode 100644 test/completion/tail.exp create mode 100644 test/completion/tar.exp create mode 100644 test/completion/tcpkill.exp create mode 100644 test/completion/tcpnice.exp create mode 100644 test/completion/tee.exp create mode 100644 test/completion/texindex.exp create mode 100644 test/completion/time.exp create mode 100644 test/completion/touch.exp create mode 100644 test/completion/tr.exp create mode 100644 test/lib/completions/tac.exp create mode 100644 test/lib/completions/tail.exp create mode 100644 test/lib/completions/tar.exp create mode 100644 test/lib/completions/tcpkill.exp create mode 100644 test/lib/completions/tcpnice.exp create mode 100644 test/lib/completions/tee.exp create mode 100644 test/lib/completions/texindex.exp create mode 100644 test/lib/completions/time.exp create mode 100644 test/lib/completions/touch.exp create mode 100644 test/lib/completions/tr.exp delete mode 100644 test/lib/completions_to_review/tac.exp delete mode 100644 test/lib/completions_to_review/tail.exp delete mode 100644 test/lib/completions_to_review/tar.exp delete mode 100644 test/lib/completions_to_review/tcpkill.exp delete mode 100644 test/lib/completions_to_review/tcpnice.exp delete mode 100644 test/lib/completions_to_review/tee.exp delete mode 100644 test/lib/completions_to_review/texindex.exp delete mode 100644 test/lib/completions_to_review/time.exp delete mode 100644 test/lib/completions_to_review/touch.exp delete mode 100644 test/lib/completions_to_review/tr.exp diff --git a/test/_completion_to_review/tac.exp b/test/_completion_to_review/tac.exp deleted file mode 100644 index bf9a032d..00000000 --- a/test/_completion_to_review/tac.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/tac.exp" diff --git a/test/_completion_to_review/tail.exp b/test/_completion_to_review/tail.exp deleted file mode 100644 index c499aa42..00000000 --- a/test/_completion_to_review/tail.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/tail.exp" diff --git a/test/_completion_to_review/tar.exp b/test/_completion_to_review/tar.exp deleted file mode 100644 index 26dcf887..00000000 --- a/test/_completion_to_review/tar.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/tar.exp" diff --git a/test/_completion_to_review/tcpkill.exp b/test/_completion_to_review/tcpkill.exp deleted file mode 100644 index df96e69a..00000000 --- a/test/_completion_to_review/tcpkill.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/tcpkill.exp" diff --git a/test/_completion_to_review/tcpnice.exp b/test/_completion_to_review/tcpnice.exp deleted file mode 100644 index fb39315f..00000000 --- a/test/_completion_to_review/tcpnice.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/tcpnice.exp" diff --git a/test/_completion_to_review/tee.exp b/test/_completion_to_review/tee.exp deleted file mode 100644 index ef30ea80..00000000 --- a/test/_completion_to_review/tee.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/tee.exp" diff --git a/test/_completion_to_review/texindex.exp b/test/_completion_to_review/texindex.exp deleted file mode 100644 index 54375323..00000000 --- a/test/_completion_to_review/texindex.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/texindex.exp" diff --git a/test/_completion_to_review/time.exp b/test/_completion_to_review/time.exp deleted file mode 100644 index 3fb7e150..00000000 --- a/test/_completion_to_review/time.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/time.exp" diff --git a/test/_completion_to_review/touch.exp b/test/_completion_to_review/touch.exp deleted file mode 100644 index d8f368d2..00000000 --- a/test/_completion_to_review/touch.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/touch.exp" diff --git a/test/_completion_to_review/tr.exp b/test/_completion_to_review/tr.exp deleted file mode 100644 index cb3fba4a..00000000 --- a/test/_completion_to_review/tr.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/tr.exp" diff --git a/test/completion/tac.exp b/test/completion/tac.exp new file mode 100644 index 00000000..60ab3729 --- /dev/null +++ b/test/completion/tac.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type tac]} { + source "lib/completions/tac.exp" +}; # if diff --git a/test/completion/tail.exp b/test/completion/tail.exp new file mode 100644 index 00000000..72793f1a --- /dev/null +++ b/test/completion/tail.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type tail]} { + source "lib/completions/tail.exp" +}; # if diff --git a/test/completion/tar.exp b/test/completion/tar.exp new file mode 100644 index 00000000..b694b660 --- /dev/null +++ b/test/completion/tar.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type tar]} { + source "lib/completions/tar.exp" +}; # if diff --git a/test/completion/tcpkill.exp b/test/completion/tcpkill.exp new file mode 100644 index 00000000..43473fc7 --- /dev/null +++ b/test/completion/tcpkill.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type tcpkill]} { + source "lib/completions/tcpkill.exp" +}; # if diff --git a/test/completion/tcpnice.exp b/test/completion/tcpnice.exp new file mode 100644 index 00000000..8d375732 --- /dev/null +++ b/test/completion/tcpnice.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type tcpnice]} { + source "lib/completions/tcpnice.exp" +}; # if diff --git a/test/completion/tee.exp b/test/completion/tee.exp new file mode 100644 index 00000000..70e96102 --- /dev/null +++ b/test/completion/tee.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type tee]} { + source "lib/completions/tee.exp" +}; # if diff --git a/test/completion/texindex.exp b/test/completion/texindex.exp new file mode 100644 index 00000000..749b5209 --- /dev/null +++ b/test/completion/texindex.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type texindex]} { + source "lib/completions/texindex.exp" +}; # if diff --git a/test/completion/tightvncviewer.exp b/test/completion/tightvncviewer.exp index a592f36d..b05ee3fc 100644 --- a/test/completion/tightvncviewer.exp +++ b/test/completion/tightvncviewer.exp @@ -1,3 +1,3 @@ -if {[assert_bash_type {tightvncviewer}]} { +if {[assert_bash_type tightvncviewer]} { source "lib/completions/tightvncviewer.exp" }; # if diff --git a/test/completion/time.exp b/test/completion/time.exp new file mode 100644 index 00000000..c4fc2352 --- /dev/null +++ b/test/completion/time.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type time]} { + source "lib/completions/time.exp" +}; # if diff --git a/test/completion/touch.exp b/test/completion/touch.exp new file mode 100644 index 00000000..2361e1f0 --- /dev/null +++ b/test/completion/touch.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type touch]} { + source "lib/completions/touch.exp" +}; # if diff --git a/test/completion/tr.exp b/test/completion/tr.exp new file mode 100644 index 00000000..8279c93a --- /dev/null +++ b/test/completion/tr.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type tr]} { + source "lib/completions/tr.exp" +}; # if diff --git a/test/lib/completions/tac.exp b/test/lib/completions/tac.exp new file mode 100644 index 00000000..21230052 --- /dev/null +++ b/test/lib/completions/tac.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tac --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/tail.exp b/test/lib/completions/tail.exp new file mode 100644 index 00000000..fb8d89e3 --- /dev/null +++ b/test/lib/completions/tail.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tail --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/tar.exp b/test/lib/completions/tar.exp new file mode 100644 index 00000000..43c60ff9 --- /dev/null +++ b/test/lib/completions/tar.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tar " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/tcpkill.exp b/test/lib/completions/tcpkill.exp new file mode 100644 index 00000000..e8cc9c10 --- /dev/null +++ b/test/lib/completions/tcpkill.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tcpkill -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/tcpnice.exp b/test/lib/completions/tcpnice.exp new file mode 100644 index 00000000..44bb59c6 --- /dev/null +++ b/test/lib/completions/tcpnice.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tcpnice -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/tee.exp b/test/lib/completions/tee.exp new file mode 100644 index 00000000..c25057ba --- /dev/null +++ b/test/lib/completions/tee.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tee " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/texindex.exp b/test/lib/completions/texindex.exp new file mode 100644 index 00000000..d5b8cd77 --- /dev/null +++ b/test/lib/completions/texindex.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "texindex --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/tightvncviewer.exp b/test/lib/completions/tightvncviewer.exp index 879e5d94..6eba24c2 100644 --- a/test/lib/completions/tightvncviewer.exp +++ b/test/lib/completions/tightvncviewer.exp @@ -11,15 +11,7 @@ proc teardown {} { setup -set test "Tab should show completions" - # Try completion -set cmd "tightvncviewer " -send "$cmd\t" -expect { - -re "$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +assert_complete_any "tightvncviewer " sync_after_int diff --git a/test/lib/completions/time.exp b/test/lib/completions/time.exp new file mode 100644 index 00000000..b114318b --- /dev/null +++ b/test/lib/completions/time.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "time set" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/touch.exp b/test/lib/completions/touch.exp new file mode 100644 index 00000000..d8b07ced --- /dev/null +++ b/test/lib/completions/touch.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "touch --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/tr.exp b/test/lib/completions/tr.exp new file mode 100644 index 00000000..87e93fad --- /dev/null +++ b/test/lib/completions/tr.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tr --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/tac.exp b/test/lib/completions_to_review/tac.exp deleted file mode 100644 index 669e6fce..00000000 --- a/test/lib/completions_to_review/tac.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "tac --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/tail.exp b/test/lib/completions_to_review/tail.exp deleted file mode 100644 index cc291b08..00000000 --- a/test/lib/completions_to_review/tail.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "tail " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/tar.exp b/test/lib/completions_to_review/tar.exp deleted file mode 100644 index 717d7258..00000000 --- a/test/lib/completions_to_review/tar.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "tar " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/tcpkill.exp b/test/lib/completions_to_review/tcpkill.exp deleted file mode 100644 index 76789b91..00000000 --- a/test/lib/completions_to_review/tcpkill.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "tcpkill -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/tcpnice.exp b/test/lib/completions_to_review/tcpnice.exp deleted file mode 100644 index 4f0e0b46..00000000 --- a/test/lib/completions_to_review/tcpnice.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "tcpnice -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/tee.exp b/test/lib/completions_to_review/tee.exp deleted file mode 100644 index 675a67df..00000000 --- a/test/lib/completions_to_review/tee.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "tee " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/texindex.exp b/test/lib/completions_to_review/texindex.exp deleted file mode 100644 index 2bf33f0e..00000000 --- a/test/lib/completions_to_review/texindex.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "texindex " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/time.exp b/test/lib/completions_to_review/time.exp deleted file mode 100644 index 2f6c26c0..00000000 --- a/test/lib/completions_to_review/time.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "time set" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/touch.exp b/test/lib/completions_to_review/touch.exp deleted file mode 100644 index abf18930..00000000 --- a/test/lib/completions_to_review/touch.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "touch " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/tr.exp b/test/lib/completions_to_review/tr.exp deleted file mode 100644 index 2d12c79f..00000000 --- a/test/lib/completions_to_review/tr.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "tr " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From 85dd9cd64cfa5130a9108fbcf54c744473957301 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 31 Jul 2009 22:53:30 +0200 Subject: [PATCH 39/69] Reviewed tests u* --- test/_completion_to_review/unace.exp | 1 - test/_completion_to_review/uname.exp | 1 - test/_completion_to_review/unexpand.exp | 1 - test/_completion_to_review/uniq.exp | 1 - test/_completion_to_review/units.exp | 1 - test/_completion_to_review/unrar.exp | 1 - test/_completion_to_review/unset.exp | 1 - test/_completion_to_review/unshunt.exp | 1 - .../update-alternatives.exp | 1 - test/_completion_to_review/update-rc.d.exp | 1 - test/_completion_to_review/urlsnarf.exp | 1 - test/completion/unace.exp | 3 +++ test/completion/uname.exp | 3 +++ test/completion/unexpand.exp | 3 +++ test/completion/uniq.exp | 3 +++ test/completion/units.exp | 3 +++ test/completion/unrar.exp | 3 +++ test/completion/unset.exp | 3 +++ test/completion/unshunt.exp | 3 +++ test/completion/update-alternatives.exp | 3 +++ test/completion/update-rc.d.exp | 3 +++ test/completion/urlsnarf.exp | 3 +++ test/lib/completions/unace.exp | 20 ++++++++++++++ test/lib/completions/uname.exp | 20 ++++++++++++++ test/lib/completions/unexpand.exp | 20 ++++++++++++++ test/lib/completions/uniq.exp | 20 ++++++++++++++ test/lib/completions/units.exp | 20 ++++++++++++++ test/lib/completions/unrar.exp | 20 ++++++++++++++ test/lib/completions/unset.exp | 20 ++++++++++++++ test/lib/completions/unshunt.exp | 20 ++++++++++++++ test/lib/completions/update-alternatives.exp | 20 ++++++++++++++ test/lib/completions/update-rc.d.exp | 20 ++++++++++++++ test/lib/completions/urlsnarf.exp | 20 ++++++++++++++ test/lib/completions_to_review/unace.exp | 26 ------------------ test/lib/completions_to_review/uname.exp | 26 ------------------ test/lib/completions_to_review/unexpand.exp | 26 ------------------ test/lib/completions_to_review/uniq.exp | 26 ------------------ test/lib/completions_to_review/units.exp | 27 ------------------- test/lib/completions_to_review/unrar.exp | 26 ------------------ test/lib/completions_to_review/unset.exp | 26 ------------------ test/lib/completions_to_review/unshunt.exp | 26 ------------------ .../update-alternatives.exp | 26 ------------------ .../lib/completions_to_review/update-rc.d.exp | 26 ------------------ test/lib/completions_to_review/urlsnarf.exp | 26 ------------------ 44 files changed, 253 insertions(+), 298 deletions(-) delete mode 100644 test/_completion_to_review/unace.exp delete mode 100644 test/_completion_to_review/uname.exp delete mode 100644 test/_completion_to_review/unexpand.exp delete mode 100644 test/_completion_to_review/uniq.exp delete mode 100644 test/_completion_to_review/units.exp delete mode 100644 test/_completion_to_review/unrar.exp delete mode 100644 test/_completion_to_review/unset.exp delete mode 100644 test/_completion_to_review/unshunt.exp delete mode 100644 test/_completion_to_review/update-alternatives.exp delete mode 100644 test/_completion_to_review/update-rc.d.exp delete mode 100644 test/_completion_to_review/urlsnarf.exp create mode 100644 test/completion/unace.exp create mode 100644 test/completion/uname.exp create mode 100644 test/completion/unexpand.exp create mode 100644 test/completion/uniq.exp create mode 100644 test/completion/units.exp create mode 100644 test/completion/unrar.exp create mode 100644 test/completion/unset.exp create mode 100644 test/completion/unshunt.exp create mode 100644 test/completion/update-alternatives.exp create mode 100644 test/completion/update-rc.d.exp create mode 100644 test/completion/urlsnarf.exp create mode 100644 test/lib/completions/unace.exp create mode 100644 test/lib/completions/uname.exp create mode 100644 test/lib/completions/unexpand.exp create mode 100644 test/lib/completions/uniq.exp create mode 100644 test/lib/completions/units.exp create mode 100644 test/lib/completions/unrar.exp create mode 100644 test/lib/completions/unset.exp create mode 100644 test/lib/completions/unshunt.exp create mode 100644 test/lib/completions/update-alternatives.exp create mode 100644 test/lib/completions/update-rc.d.exp create mode 100644 test/lib/completions/urlsnarf.exp delete mode 100644 test/lib/completions_to_review/unace.exp delete mode 100644 test/lib/completions_to_review/uname.exp delete mode 100644 test/lib/completions_to_review/unexpand.exp delete mode 100644 test/lib/completions_to_review/uniq.exp delete mode 100644 test/lib/completions_to_review/units.exp delete mode 100644 test/lib/completions_to_review/unrar.exp delete mode 100644 test/lib/completions_to_review/unset.exp delete mode 100644 test/lib/completions_to_review/unshunt.exp delete mode 100644 test/lib/completions_to_review/update-alternatives.exp delete mode 100644 test/lib/completions_to_review/update-rc.d.exp delete mode 100644 test/lib/completions_to_review/urlsnarf.exp diff --git a/test/_completion_to_review/unace.exp b/test/_completion_to_review/unace.exp deleted file mode 100644 index ec604145..00000000 --- a/test/_completion_to_review/unace.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/unace.exp" diff --git a/test/_completion_to_review/uname.exp b/test/_completion_to_review/uname.exp deleted file mode 100644 index 63baea5c..00000000 --- a/test/_completion_to_review/uname.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/uname.exp" diff --git a/test/_completion_to_review/unexpand.exp b/test/_completion_to_review/unexpand.exp deleted file mode 100644 index 0ffe2417..00000000 --- a/test/_completion_to_review/unexpand.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/unexpand.exp" diff --git a/test/_completion_to_review/uniq.exp b/test/_completion_to_review/uniq.exp deleted file mode 100644 index e545c639..00000000 --- a/test/_completion_to_review/uniq.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/uniq.exp" diff --git a/test/_completion_to_review/units.exp b/test/_completion_to_review/units.exp deleted file mode 100644 index 06df2083..00000000 --- a/test/_completion_to_review/units.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/units.exp" diff --git a/test/_completion_to_review/unrar.exp b/test/_completion_to_review/unrar.exp deleted file mode 100644 index 544fb182..00000000 --- a/test/_completion_to_review/unrar.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/unrar.exp" diff --git a/test/_completion_to_review/unset.exp b/test/_completion_to_review/unset.exp deleted file mode 100644 index 3e90e467..00000000 --- a/test/_completion_to_review/unset.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/unset.exp" diff --git a/test/_completion_to_review/unshunt.exp b/test/_completion_to_review/unshunt.exp deleted file mode 100644 index e4194251..00000000 --- a/test/_completion_to_review/unshunt.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/unshunt.exp" diff --git a/test/_completion_to_review/update-alternatives.exp b/test/_completion_to_review/update-alternatives.exp deleted file mode 100644 index 9237b8af..00000000 --- a/test/_completion_to_review/update-alternatives.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/update-alternatives.exp" diff --git a/test/_completion_to_review/update-rc.d.exp b/test/_completion_to_review/update-rc.d.exp deleted file mode 100644 index 5f4ec912..00000000 --- a/test/_completion_to_review/update-rc.d.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/update-rc.d.exp" diff --git a/test/_completion_to_review/urlsnarf.exp b/test/_completion_to_review/urlsnarf.exp deleted file mode 100644 index 68108595..00000000 --- a/test/_completion_to_review/urlsnarf.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/urlsnarf.exp" diff --git a/test/completion/unace.exp b/test/completion/unace.exp new file mode 100644 index 00000000..052a39f6 --- /dev/null +++ b/test/completion/unace.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type unace]} { + source "lib/completions/unace.exp" +}; # if diff --git a/test/completion/uname.exp b/test/completion/uname.exp new file mode 100644 index 00000000..e53f2724 --- /dev/null +++ b/test/completion/uname.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type uname]} { + source "lib/completions/uname.exp" +}; # if diff --git a/test/completion/unexpand.exp b/test/completion/unexpand.exp new file mode 100644 index 00000000..cb6a165a --- /dev/null +++ b/test/completion/unexpand.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type unexpand]} { + source "lib/completions/unexpand.exp" +}; # if diff --git a/test/completion/uniq.exp b/test/completion/uniq.exp new file mode 100644 index 00000000..c535ae93 --- /dev/null +++ b/test/completion/uniq.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type uniq]} { + source "lib/completions/uniq.exp" +}; # if diff --git a/test/completion/units.exp b/test/completion/units.exp new file mode 100644 index 00000000..db77cef7 --- /dev/null +++ b/test/completion/units.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type units]} { + source "lib/completions/units.exp" +}; # if diff --git a/test/completion/unrar.exp b/test/completion/unrar.exp new file mode 100644 index 00000000..892b3209 --- /dev/null +++ b/test/completion/unrar.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type unrar]} { + source "lib/completions/unrar.exp" +}; # if diff --git a/test/completion/unset.exp b/test/completion/unset.exp new file mode 100644 index 00000000..5b262162 --- /dev/null +++ b/test/completion/unset.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type unset]} { + source "lib/completions/unset.exp" +}; # if diff --git a/test/completion/unshunt.exp b/test/completion/unshunt.exp new file mode 100644 index 00000000..a86619ad --- /dev/null +++ b/test/completion/unshunt.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type unshunt]} { + source "lib/completions/unshunt.exp" +}; # if diff --git a/test/completion/update-alternatives.exp b/test/completion/update-alternatives.exp new file mode 100644 index 00000000..9fe1bc6c --- /dev/null +++ b/test/completion/update-alternatives.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type update-alternatives]} { + source "lib/completions/update-alternatives.exp" +}; # if diff --git a/test/completion/update-rc.d.exp b/test/completion/update-rc.d.exp new file mode 100644 index 00000000..98cf859e --- /dev/null +++ b/test/completion/update-rc.d.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type update-rc.d]} { + source "lib/completions/update-rc.d.exp" +}; # if diff --git a/test/completion/urlsnarf.exp b/test/completion/urlsnarf.exp new file mode 100644 index 00000000..beae4ceb --- /dev/null +++ b/test/completion/urlsnarf.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type urlsnarf]} { + source "lib/completions/urlsnarf.exp" +}; # if diff --git a/test/lib/completions/unace.exp b/test/lib/completions/unace.exp new file mode 100644 index 00000000..0afbaafb --- /dev/null +++ b/test/lib/completions/unace.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unace -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/uname.exp b/test/lib/completions/uname.exp new file mode 100644 index 00000000..8de0eeda --- /dev/null +++ b/test/lib/completions/uname.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "uname --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/unexpand.exp b/test/lib/completions/unexpand.exp new file mode 100644 index 00000000..ecb726fd --- /dev/null +++ b/test/lib/completions/unexpand.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unexpand --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/uniq.exp b/test/lib/completions/uniq.exp new file mode 100644 index 00000000..6b915596 --- /dev/null +++ b/test/lib/completions/uniq.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "uniq --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/units.exp b/test/lib/completions/units.exp new file mode 100644 index 00000000..b4c52b03 --- /dev/null +++ b/test/lib/completions/units.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "units --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/unrar.exp b/test/lib/completions/unrar.exp new file mode 100644 index 00000000..e66e3c8b --- /dev/null +++ b/test/lib/completions/unrar.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unrar -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/unset.exp b/test/lib/completions/unset.exp new file mode 100644 index 00000000..a5e7fc9b --- /dev/null +++ b/test/lib/completions/unset.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unset BASH_ARG" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/unshunt.exp b/test/lib/completions/unshunt.exp new file mode 100644 index 00000000..964cac68 --- /dev/null +++ b/test/lib/completions/unshunt.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unshunt -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/update-alternatives.exp b/test/lib/completions/update-alternatives.exp new file mode 100644 index 00000000..10ff4e6d --- /dev/null +++ b/test/lib/completions/update-alternatives.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "update-alternatives --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/update-rc.d.exp b/test/lib/completions/update-rc.d.exp new file mode 100644 index 00000000..9c2c2464 --- /dev/null +++ b/test/lib/completions/update-rc.d.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "update-rc.d -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/urlsnarf.exp b/test/lib/completions/urlsnarf.exp new file mode 100644 index 00000000..c5b26922 --- /dev/null +++ b/test/lib/completions/urlsnarf.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "urlsnarf -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/unace.exp b/test/lib/completions_to_review/unace.exp deleted file mode 100644 index b28b898a..00000000 --- a/test/lib/completions_to_review/unace.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "unace " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/uname.exp b/test/lib/completions_to_review/uname.exp deleted file mode 100644 index eaf7fcfc..00000000 --- a/test/lib/completions_to_review/uname.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "uname --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/unexpand.exp b/test/lib/completions_to_review/unexpand.exp deleted file mode 100644 index e061d13e..00000000 --- a/test/lib/completions_to_review/unexpand.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "unexpand " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/uniq.exp b/test/lib/completions_to_review/uniq.exp deleted file mode 100644 index 27417a18..00000000 --- a/test/lib/completions_to_review/uniq.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "uniq " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/units.exp b/test/lib/completions_to_review/units.exp deleted file mode 100644 index eb3ebe86..00000000 --- a/test/lib/completions_to_review/units.exp +++ /dev/null @@ -1,27 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "units --" -send "$cmd\t" -sync_after_tab -expect { - -re "^$cmd.*$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/unrar.exp b/test/lib/completions_to_review/unrar.exp deleted file mode 100644 index 6c1c56ad..00000000 --- a/test/lib/completions_to_review/unrar.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "unrar " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/unset.exp b/test/lib/completions_to_review/unset.exp deleted file mode 100644 index b070ed37..00000000 --- a/test/lib/completions_to_review/unset.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "unset BASH_ARG" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/unshunt.exp b/test/lib/completions_to_review/unshunt.exp deleted file mode 100644 index ccf56f96..00000000 --- a/test/lib/completions_to_review/unshunt.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "unshunt " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/update-alternatives.exp b/test/lib/completions_to_review/update-alternatives.exp deleted file mode 100644 index ed437794..00000000 --- a/test/lib/completions_to_review/update-alternatives.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "update-alternatives --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/update-rc.d.exp b/test/lib/completions_to_review/update-rc.d.exp deleted file mode 100644 index 92fffd37..00000000 --- a/test/lib/completions_to_review/update-rc.d.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "update-rc.d -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/urlsnarf.exp b/test/lib/completions_to_review/urlsnarf.exp deleted file mode 100644 index 620c4c39..00000000 --- a/test/lib/completions_to_review/urlsnarf.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "urlsnarf -" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From 90fc7be01199d85404dfa157a2ff7f82cc3abfd2 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sat, 1 Aug 2009 09:35:24 +0200 Subject: [PATCH 40/69] Reviewed tests v*, w*, x* & y* Directories `test/_completion_to_review' & 'lib/completions_to_review' are now removed. --- test/_completion_to_review/vdir.exp | 1 - test/_completion_to_review/wc.exp | 1 - test/_completion_to_review/webmitm.exp | 1 - test/_completion_to_review/wget.exp | 1 - test/_completion_to_review/who.exp | 1 - test/_completion_to_review/withlist.exp | 1 - test/_completion_to_review/wvdial.exp | 1 - test/_completion_to_review/xpovray.exp | 1 - test/_completion_to_review/ypcat.exp | 1 - test/_completion_to_review/ypmatch.exp | 1 - test/_completion_to_review/yum-arch.exp | 1 - test/_completion_to_review/yum.exp | 1 - test/completion/vdir.exp | 3 +++ .../vgcfgbackup.exp | 0 .../vgcfgrestore.exp | 0 .../vgchange.exp | 0 .../vgck.exp | 0 .../vgconvert.exp | 0 .../vgcreate.exp | 0 .../vgdisplay.exp | 0 .../vgexport.exp | 0 .../vgextend.exp | 0 .../vgimport.exp | 0 .../vgmerge.exp | 0 .../vgmknodes.exp | 0 .../vgreduce.exp | 0 .../vgremove.exp | 0 .../vgrename.exp | 0 .../vgs.exp | 0 .../vgscan.exp | 0 .../vgsplit.exp | 0 test/completion/vncviewer.exp | 4 ++- test/completion/wc.exp | 3 +++ test/completion/webmitm.exp | 3 +++ test/completion/wget.exp | 3 +++ test/completion/who.exp | 3 +++ test/completion/withlist.exp | 3 +++ test/completion/wvdial.exp | 3 +++ test/completion/xhost.exp | 9 +++---- .../xmms.exp | 0 test/completion/xpovray.exp | 3 +++ test/completion/ypcat.exp | 3 +++ test/completion/ypmatch.exp | 3 +++ test/completion/yum-arch.exp | 3 +++ test/completion/yum.exp | 3 +++ test/lib/completions/vdir.exp | 20 ++++++++++++++ test/lib/completions/vgcfgbackup.exp | 20 ++++++++++++++ test/lib/completions/vgcfgrestore.exp | 20 ++++++++++++++ test/lib/completions/vgchange.exp | 20 ++++++++++++++ test/lib/completions/vgck.exp | 20 ++++++++++++++ test/lib/completions/vgconvert.exp | 20 ++++++++++++++ test/lib/completions/vgcreate.exp | 20 ++++++++++++++ test/lib/completions/vgdisplay.exp | 20 ++++++++++++++ test/lib/completions/vgexport.exp | 20 ++++++++++++++ test/lib/completions/vgextend.exp | 20 ++++++++++++++ test/lib/completions/vgimport.exp | 20 ++++++++++++++ test/lib/completions/vgmerge.exp | 20 ++++++++++++++ test/lib/completions/vgmknodes.exp | 20 ++++++++++++++ test/lib/completions/vgreduce.exp | 20 ++++++++++++++ test/lib/completions/vgremove.exp | 20 ++++++++++++++ test/lib/completions/vgrename.exp | 20 ++++++++++++++ test/lib/completions/vgs.exp | 20 ++++++++++++++ test/lib/completions/vgscan.exp | 20 ++++++++++++++ test/lib/completions/vgsplit.exp | 20 ++++++++++++++ test/lib/completions/vncviewer.exp | 10 +------ test/lib/completions/wc.exp | 20 ++++++++++++++ test/lib/completions/webmitm.exp | 20 ++++++++++++++ test/lib/completions/wget.exp | 20 ++++++++++++++ test/lib/completions/who.exp | 20 ++++++++++++++ test/lib/completions/withlist.exp | 20 ++++++++++++++ test/lib/completions/wvdial.exp | 20 ++++++++++++++ test/lib/completions/xmms.exp | 20 ++++++++++++++ test/lib/completions/xpovray.exp | 20 ++++++++++++++ test/lib/completions/xvnc4viewer.exp | 22 +++------------ test/lib/completions/ypcat.exp | 20 ++++++++++++++ test/lib/completions/ypmatch.exp | 20 ++++++++++++++ test/lib/completions/yum-arch.exp | 20 ++++++++++++++ test/lib/completions/yum.exp | 20 ++++++++++++++ test/lib/completions_to_review/vdir.exp | 26 ------------------ .../lib/completions_to_review/vgcfgbackup.exp | 26 ------------------ .../completions_to_review/vgcfgrestore.exp | 26 ------------------ test/lib/completions_to_review/vgchange.exp | 26 ------------------ test/lib/completions_to_review/vgck.exp | 26 ------------------ test/lib/completions_to_review/vgconvert.exp | 26 ------------------ test/lib/completions_to_review/vgcreate.exp | 26 ------------------ test/lib/completions_to_review/vgdisplay.exp | 26 ------------------ test/lib/completions_to_review/vgexport.exp | 26 ------------------ test/lib/completions_to_review/vgextend.exp | 26 ------------------ test/lib/completions_to_review/vgimport.exp | 26 ------------------ test/lib/completions_to_review/vgmerge.exp | 26 ------------------ test/lib/completions_to_review/vgmknodes.exp | 26 ------------------ test/lib/completions_to_review/vgreduce.exp | 26 ------------------ test/lib/completions_to_review/vgremove.exp | 26 ------------------ test/lib/completions_to_review/vgrename.exp | 26 ------------------ test/lib/completions_to_review/vgs.exp | 26 ------------------ test/lib/completions_to_review/vgscan.exp | 26 ------------------ test/lib/completions_to_review/vgsplit.exp | 26 ------------------ test/lib/completions_to_review/wc.exp | 26 ------------------ test/lib/completions_to_review/webmitm.exp | 26 ------------------ test/lib/completions_to_review/wget.exp | 26 ------------------ test/lib/completions_to_review/who.exp | 26 ------------------ test/lib/completions_to_review/withlist.exp | 26 ------------------ test/lib/completions_to_review/wvdial.exp | 26 ------------------ test/lib/completions_to_review/xmms.exp | 26 ------------------ test/lib/completions_to_review/xpovray.exp | 26 ------------------ test/lib/completions_to_review/ypcat.exp | 27 ------------------- test/lib/completions_to_review/ypmatch.exp | 27 ------------------- test/lib/completions_to_review/yum-arch.exp | 26 ------------------ test/lib/completions_to_review/yum.exp | 26 ------------------ 109 files changed, 667 insertions(+), 854 deletions(-) delete mode 100644 test/_completion_to_review/vdir.exp delete mode 100644 test/_completion_to_review/wc.exp delete mode 100644 test/_completion_to_review/webmitm.exp delete mode 100644 test/_completion_to_review/wget.exp delete mode 100644 test/_completion_to_review/who.exp delete mode 100644 test/_completion_to_review/withlist.exp delete mode 100644 test/_completion_to_review/wvdial.exp delete mode 100644 test/_completion_to_review/xpovray.exp delete mode 100644 test/_completion_to_review/ypcat.exp delete mode 100644 test/_completion_to_review/ypmatch.exp delete mode 100644 test/_completion_to_review/yum-arch.exp delete mode 100644 test/_completion_to_review/yum.exp create mode 100644 test/completion/vdir.exp rename test/{_completion_to_review => completion}/vgcfgbackup.exp (100%) rename test/{_completion_to_review => completion}/vgcfgrestore.exp (100%) rename test/{_completion_to_review => completion}/vgchange.exp (100%) rename test/{_completion_to_review => completion}/vgck.exp (100%) rename test/{_completion_to_review => completion}/vgconvert.exp (100%) rename test/{_completion_to_review => completion}/vgcreate.exp (100%) rename test/{_completion_to_review => completion}/vgdisplay.exp (100%) rename test/{_completion_to_review => completion}/vgexport.exp (100%) rename test/{_completion_to_review => completion}/vgextend.exp (100%) rename test/{_completion_to_review => completion}/vgimport.exp (100%) rename test/{_completion_to_review => completion}/vgmerge.exp (100%) rename test/{_completion_to_review => completion}/vgmknodes.exp (100%) rename test/{_completion_to_review => completion}/vgreduce.exp (100%) rename test/{_completion_to_review => completion}/vgremove.exp (100%) rename test/{_completion_to_review => completion}/vgrename.exp (100%) rename test/{_completion_to_review => completion}/vgs.exp (100%) rename test/{_completion_to_review => completion}/vgscan.exp (100%) rename test/{_completion_to_review => completion}/vgsplit.exp (100%) create mode 100644 test/completion/wc.exp create mode 100644 test/completion/webmitm.exp create mode 100644 test/completion/wget.exp create mode 100644 test/completion/who.exp create mode 100644 test/completion/withlist.exp create mode 100644 test/completion/wvdial.exp rename test/{_completion_to_review => completion}/xmms.exp (100%) create mode 100644 test/completion/xpovray.exp create mode 100644 test/completion/ypcat.exp create mode 100644 test/completion/ypmatch.exp create mode 100644 test/completion/yum-arch.exp create mode 100644 test/completion/yum.exp create mode 100644 test/lib/completions/vdir.exp create mode 100644 test/lib/completions/vgcfgbackup.exp create mode 100644 test/lib/completions/vgcfgrestore.exp create mode 100644 test/lib/completions/vgchange.exp create mode 100644 test/lib/completions/vgck.exp create mode 100644 test/lib/completions/vgconvert.exp create mode 100644 test/lib/completions/vgcreate.exp create mode 100644 test/lib/completions/vgdisplay.exp create mode 100644 test/lib/completions/vgexport.exp create mode 100644 test/lib/completions/vgextend.exp create mode 100644 test/lib/completions/vgimport.exp create mode 100644 test/lib/completions/vgmerge.exp create mode 100644 test/lib/completions/vgmknodes.exp create mode 100644 test/lib/completions/vgreduce.exp create mode 100644 test/lib/completions/vgremove.exp create mode 100644 test/lib/completions/vgrename.exp create mode 100644 test/lib/completions/vgs.exp create mode 100644 test/lib/completions/vgscan.exp create mode 100644 test/lib/completions/vgsplit.exp create mode 100644 test/lib/completions/wc.exp create mode 100644 test/lib/completions/webmitm.exp create mode 100644 test/lib/completions/wget.exp create mode 100644 test/lib/completions/who.exp create mode 100644 test/lib/completions/withlist.exp create mode 100644 test/lib/completions/wvdial.exp create mode 100644 test/lib/completions/xmms.exp create mode 100644 test/lib/completions/xpovray.exp create mode 100644 test/lib/completions/ypcat.exp create mode 100644 test/lib/completions/ypmatch.exp create mode 100644 test/lib/completions/yum-arch.exp create mode 100644 test/lib/completions/yum.exp delete mode 100644 test/lib/completions_to_review/vdir.exp delete mode 100644 test/lib/completions_to_review/vgcfgbackup.exp delete mode 100644 test/lib/completions_to_review/vgcfgrestore.exp delete mode 100644 test/lib/completions_to_review/vgchange.exp delete mode 100644 test/lib/completions_to_review/vgck.exp delete mode 100644 test/lib/completions_to_review/vgconvert.exp delete mode 100644 test/lib/completions_to_review/vgcreate.exp delete mode 100644 test/lib/completions_to_review/vgdisplay.exp delete mode 100644 test/lib/completions_to_review/vgexport.exp delete mode 100644 test/lib/completions_to_review/vgextend.exp delete mode 100644 test/lib/completions_to_review/vgimport.exp delete mode 100644 test/lib/completions_to_review/vgmerge.exp delete mode 100644 test/lib/completions_to_review/vgmknodes.exp delete mode 100644 test/lib/completions_to_review/vgreduce.exp delete mode 100644 test/lib/completions_to_review/vgremove.exp delete mode 100644 test/lib/completions_to_review/vgrename.exp delete mode 100644 test/lib/completions_to_review/vgs.exp delete mode 100644 test/lib/completions_to_review/vgscan.exp delete mode 100644 test/lib/completions_to_review/vgsplit.exp delete mode 100644 test/lib/completions_to_review/wc.exp delete mode 100644 test/lib/completions_to_review/webmitm.exp delete mode 100644 test/lib/completions_to_review/wget.exp delete mode 100644 test/lib/completions_to_review/who.exp delete mode 100644 test/lib/completions_to_review/withlist.exp delete mode 100644 test/lib/completions_to_review/wvdial.exp delete mode 100644 test/lib/completions_to_review/xmms.exp delete mode 100644 test/lib/completions_to_review/xpovray.exp delete mode 100644 test/lib/completions_to_review/ypcat.exp delete mode 100644 test/lib/completions_to_review/ypmatch.exp delete mode 100644 test/lib/completions_to_review/yum-arch.exp delete mode 100644 test/lib/completions_to_review/yum.exp diff --git a/test/_completion_to_review/vdir.exp b/test/_completion_to_review/vdir.exp deleted file mode 100644 index 49413713..00000000 --- a/test/_completion_to_review/vdir.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/vdir.exp" diff --git a/test/_completion_to_review/wc.exp b/test/_completion_to_review/wc.exp deleted file mode 100644 index 78221d66..00000000 --- a/test/_completion_to_review/wc.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/wc.exp" diff --git a/test/_completion_to_review/webmitm.exp b/test/_completion_to_review/webmitm.exp deleted file mode 100644 index 2a991c7c..00000000 --- a/test/_completion_to_review/webmitm.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/webmitm.exp" diff --git a/test/_completion_to_review/wget.exp b/test/_completion_to_review/wget.exp deleted file mode 100644 index b2485d81..00000000 --- a/test/_completion_to_review/wget.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/wget.exp" diff --git a/test/_completion_to_review/who.exp b/test/_completion_to_review/who.exp deleted file mode 100644 index 3e9986f6..00000000 --- a/test/_completion_to_review/who.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/who.exp" diff --git a/test/_completion_to_review/withlist.exp b/test/_completion_to_review/withlist.exp deleted file mode 100644 index bfd3aa27..00000000 --- a/test/_completion_to_review/withlist.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/withlist.exp" diff --git a/test/_completion_to_review/wvdial.exp b/test/_completion_to_review/wvdial.exp deleted file mode 100644 index 04e64d00..00000000 --- a/test/_completion_to_review/wvdial.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/wvdial.exp" diff --git a/test/_completion_to_review/xpovray.exp b/test/_completion_to_review/xpovray.exp deleted file mode 100644 index e6b9a2bc..00000000 --- a/test/_completion_to_review/xpovray.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/xpovray.exp" diff --git a/test/_completion_to_review/ypcat.exp b/test/_completion_to_review/ypcat.exp deleted file mode 100644 index fdb9f507..00000000 --- a/test/_completion_to_review/ypcat.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ypcat.exp" diff --git a/test/_completion_to_review/ypmatch.exp b/test/_completion_to_review/ypmatch.exp deleted file mode 100644 index dac077b2..00000000 --- a/test/_completion_to_review/ypmatch.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/ypmatch.exp" diff --git a/test/_completion_to_review/yum-arch.exp b/test/_completion_to_review/yum-arch.exp deleted file mode 100644 index b0489a43..00000000 --- a/test/_completion_to_review/yum-arch.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/yum-arch.exp" diff --git a/test/_completion_to_review/yum.exp b/test/_completion_to_review/yum.exp deleted file mode 100644 index 8b9a3ee4..00000000 --- a/test/_completion_to_review/yum.exp +++ /dev/null @@ -1 +0,0 @@ -source "lib/completions/yum.exp" diff --git a/test/completion/vdir.exp b/test/completion/vdir.exp new file mode 100644 index 00000000..287d8c1b --- /dev/null +++ b/test/completion/vdir.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type vdir]} { + source "lib/completions/vdir.exp" +}; # if diff --git a/test/_completion_to_review/vgcfgbackup.exp b/test/completion/vgcfgbackup.exp similarity index 100% rename from test/_completion_to_review/vgcfgbackup.exp rename to test/completion/vgcfgbackup.exp diff --git a/test/_completion_to_review/vgcfgrestore.exp b/test/completion/vgcfgrestore.exp similarity index 100% rename from test/_completion_to_review/vgcfgrestore.exp rename to test/completion/vgcfgrestore.exp diff --git a/test/_completion_to_review/vgchange.exp b/test/completion/vgchange.exp similarity index 100% rename from test/_completion_to_review/vgchange.exp rename to test/completion/vgchange.exp diff --git a/test/_completion_to_review/vgck.exp b/test/completion/vgck.exp similarity index 100% rename from test/_completion_to_review/vgck.exp rename to test/completion/vgck.exp diff --git a/test/_completion_to_review/vgconvert.exp b/test/completion/vgconvert.exp similarity index 100% rename from test/_completion_to_review/vgconvert.exp rename to test/completion/vgconvert.exp diff --git a/test/_completion_to_review/vgcreate.exp b/test/completion/vgcreate.exp similarity index 100% rename from test/_completion_to_review/vgcreate.exp rename to test/completion/vgcreate.exp diff --git a/test/_completion_to_review/vgdisplay.exp b/test/completion/vgdisplay.exp similarity index 100% rename from test/_completion_to_review/vgdisplay.exp rename to test/completion/vgdisplay.exp diff --git a/test/_completion_to_review/vgexport.exp b/test/completion/vgexport.exp similarity index 100% rename from test/_completion_to_review/vgexport.exp rename to test/completion/vgexport.exp diff --git a/test/_completion_to_review/vgextend.exp b/test/completion/vgextend.exp similarity index 100% rename from test/_completion_to_review/vgextend.exp rename to test/completion/vgextend.exp diff --git a/test/_completion_to_review/vgimport.exp b/test/completion/vgimport.exp similarity index 100% rename from test/_completion_to_review/vgimport.exp rename to test/completion/vgimport.exp diff --git a/test/_completion_to_review/vgmerge.exp b/test/completion/vgmerge.exp similarity index 100% rename from test/_completion_to_review/vgmerge.exp rename to test/completion/vgmerge.exp diff --git a/test/_completion_to_review/vgmknodes.exp b/test/completion/vgmknodes.exp similarity index 100% rename from test/_completion_to_review/vgmknodes.exp rename to test/completion/vgmknodes.exp diff --git a/test/_completion_to_review/vgreduce.exp b/test/completion/vgreduce.exp similarity index 100% rename from test/_completion_to_review/vgreduce.exp rename to test/completion/vgreduce.exp diff --git a/test/_completion_to_review/vgremove.exp b/test/completion/vgremove.exp similarity index 100% rename from test/_completion_to_review/vgremove.exp rename to test/completion/vgremove.exp diff --git a/test/_completion_to_review/vgrename.exp b/test/completion/vgrename.exp similarity index 100% rename from test/_completion_to_review/vgrename.exp rename to test/completion/vgrename.exp diff --git a/test/_completion_to_review/vgs.exp b/test/completion/vgs.exp similarity index 100% rename from test/_completion_to_review/vgs.exp rename to test/completion/vgs.exp diff --git a/test/_completion_to_review/vgscan.exp b/test/completion/vgscan.exp similarity index 100% rename from test/_completion_to_review/vgscan.exp rename to test/completion/vgscan.exp diff --git a/test/_completion_to_review/vgsplit.exp b/test/completion/vgsplit.exp similarity index 100% rename from test/_completion_to_review/vgsplit.exp rename to test/completion/vgsplit.exp diff --git a/test/completion/vncviewer.exp b/test/completion/vncviewer.exp index 17032783..657c00bc 100644 --- a/test/completion/vncviewer.exp +++ b/test/completion/vncviewer.exp @@ -1 +1,3 @@ -source "lib/completions/vncviewer.exp" +if {[assert_bash_type vncviewer]} { + source "lib/completions/vncviewer.exp" +}; # if diff --git a/test/completion/wc.exp b/test/completion/wc.exp new file mode 100644 index 00000000..d77b49b8 --- /dev/null +++ b/test/completion/wc.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type wc]} { + source "lib/completions/wc.exp" +}; # if diff --git a/test/completion/webmitm.exp b/test/completion/webmitm.exp new file mode 100644 index 00000000..48ef7d9e --- /dev/null +++ b/test/completion/webmitm.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type webmitm]} { + source "lib/completions/webmitm.exp" +}; # if diff --git a/test/completion/wget.exp b/test/completion/wget.exp new file mode 100644 index 00000000..86d30583 --- /dev/null +++ b/test/completion/wget.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type wget]} { + source "lib/completions/wget.exp" +}; # if diff --git a/test/completion/who.exp b/test/completion/who.exp new file mode 100644 index 00000000..c6df2a43 --- /dev/null +++ b/test/completion/who.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type who]} { + source "lib/completions/who.exp" +}; # if diff --git a/test/completion/withlist.exp b/test/completion/withlist.exp new file mode 100644 index 00000000..d7298982 --- /dev/null +++ b/test/completion/withlist.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type withlist]} { + source "lib/completions/withlist.exp" +}; # if diff --git a/test/completion/wvdial.exp b/test/completion/wvdial.exp new file mode 100644 index 00000000..d62eabf8 --- /dev/null +++ b/test/completion/wvdial.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type wvdial]} { + source "lib/completions/wvdial.exp" +}; # if diff --git a/test/completion/xhost.exp b/test/completion/xhost.exp index e79abf5d..31ae9e6b 100644 --- a/test/completion/xhost.exp +++ b/test/completion/xhost.exp @@ -1,6 +1,3 @@ -source "lib/completions/xhost.exp" - -# TODO: Dynamic loading of completions. After the tests have the first time and -# real completion is installed, the tests can be run a second time. -# -# source "lib/completions/ssh.exp" +if {[assert_bash_type {xhost}]} { + source "lib/completions/xhost.exp" +}; # if diff --git a/test/_completion_to_review/xmms.exp b/test/completion/xmms.exp similarity index 100% rename from test/_completion_to_review/xmms.exp rename to test/completion/xmms.exp diff --git a/test/completion/xpovray.exp b/test/completion/xpovray.exp new file mode 100644 index 00000000..51eea73e --- /dev/null +++ b/test/completion/xpovray.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type xpovray]} { + source "lib/completions/xpovray.exp" +}; # if diff --git a/test/completion/ypcat.exp b/test/completion/ypcat.exp new file mode 100644 index 00000000..516a8847 --- /dev/null +++ b/test/completion/ypcat.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type ypcat]} { + source "lib/completions/ypcat.exp" +}; # if diff --git a/test/completion/ypmatch.exp b/test/completion/ypmatch.exp new file mode 100644 index 00000000..e4564790 --- /dev/null +++ b/test/completion/ypmatch.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type ypmatch]} { + source "lib/completions/ypmatch.exp" +}; # if diff --git a/test/completion/yum-arch.exp b/test/completion/yum-arch.exp new file mode 100644 index 00000000..3c30a871 --- /dev/null +++ b/test/completion/yum-arch.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type yum-arch]} { + source "lib/completions/yum-arch.exp" +}; # if diff --git a/test/completion/yum.exp b/test/completion/yum.exp new file mode 100644 index 00000000..247f05b7 --- /dev/null +++ b/test/completion/yum.exp @@ -0,0 +1,3 @@ +if {[assert_bash_type yum]} { + source "lib/completions/yum.exp" +}; # if diff --git a/test/lib/completions/vdir.exp b/test/lib/completions/vdir.exp new file mode 100644 index 00000000..b525c382 --- /dev/null +++ b/test/lib/completions/vdir.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vdir " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgcfgbackup.exp b/test/lib/completions/vgcfgbackup.exp new file mode 100644 index 00000000..19ceeeca --- /dev/null +++ b/test/lib/completions/vgcfgbackup.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgcfgbackup -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgcfgrestore.exp b/test/lib/completions/vgcfgrestore.exp new file mode 100644 index 00000000..e1c3c3b9 --- /dev/null +++ b/test/lib/completions/vgcfgrestore.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgcfgrestore -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgchange.exp b/test/lib/completions/vgchange.exp new file mode 100644 index 00000000..645eedb4 --- /dev/null +++ b/test/lib/completions/vgchange.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgchange -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgck.exp b/test/lib/completions/vgck.exp new file mode 100644 index 00000000..67209b15 --- /dev/null +++ b/test/lib/completions/vgck.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgck -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgconvert.exp b/test/lib/completions/vgconvert.exp new file mode 100644 index 00000000..065c4828 --- /dev/null +++ b/test/lib/completions/vgconvert.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgconvert -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgcreate.exp b/test/lib/completions/vgcreate.exp new file mode 100644 index 00000000..7c324e62 --- /dev/null +++ b/test/lib/completions/vgcreate.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgcreate -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgdisplay.exp b/test/lib/completions/vgdisplay.exp new file mode 100644 index 00000000..b6bc9125 --- /dev/null +++ b/test/lib/completions/vgdisplay.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgdisplay -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgexport.exp b/test/lib/completions/vgexport.exp new file mode 100644 index 00000000..2ad4230e --- /dev/null +++ b/test/lib/completions/vgexport.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgexport -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgextend.exp b/test/lib/completions/vgextend.exp new file mode 100644 index 00000000..18a491d2 --- /dev/null +++ b/test/lib/completions/vgextend.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgextend -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgimport.exp b/test/lib/completions/vgimport.exp new file mode 100644 index 00000000..e4568f3b --- /dev/null +++ b/test/lib/completions/vgimport.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgimport -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgmerge.exp b/test/lib/completions/vgmerge.exp new file mode 100644 index 00000000..8ba5e893 --- /dev/null +++ b/test/lib/completions/vgmerge.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgmerge -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgmknodes.exp b/test/lib/completions/vgmknodes.exp new file mode 100644 index 00000000..d24552f0 --- /dev/null +++ b/test/lib/completions/vgmknodes.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgmknodes -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgreduce.exp b/test/lib/completions/vgreduce.exp new file mode 100644 index 00000000..887ba8de --- /dev/null +++ b/test/lib/completions/vgreduce.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgreduce -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgremove.exp b/test/lib/completions/vgremove.exp new file mode 100644 index 00000000..26dadf95 --- /dev/null +++ b/test/lib/completions/vgremove.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgremove -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgrename.exp b/test/lib/completions/vgrename.exp new file mode 100644 index 00000000..8ddaa758 --- /dev/null +++ b/test/lib/completions/vgrename.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgrename -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgs.exp b/test/lib/completions/vgs.exp new file mode 100644 index 00000000..a27e3650 --- /dev/null +++ b/test/lib/completions/vgs.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgs -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgscan.exp b/test/lib/completions/vgscan.exp new file mode 100644 index 00000000..4bb8c35e --- /dev/null +++ b/test/lib/completions/vgscan.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgscan -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vgsplit.exp b/test/lib/completions/vgsplit.exp new file mode 100644 index 00000000..54e7034f --- /dev/null +++ b/test/lib/completions/vgsplit.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgsplit -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/vncviewer.exp b/test/lib/completions/vncviewer.exp index bde8e7e3..8d619c51 100644 --- a/test/lib/completions/vncviewer.exp +++ b/test/lib/completions/vncviewer.exp @@ -11,15 +11,7 @@ proc teardown {} { setup -set test "Tab should show completions" - # Try completion -set cmd "xvnc4viewer " -send "$cmd\t" -expect { - -re "$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +assert_complete_any "vncviewer " sync_after_int diff --git a/test/lib/completions/wc.exp b/test/lib/completions/wc.exp new file mode 100644 index 00000000..d4e04ca2 --- /dev/null +++ b/test/lib/completions/wc.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "wc --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/webmitm.exp b/test/lib/completions/webmitm.exp new file mode 100644 index 00000000..1d48a3a6 --- /dev/null +++ b/test/lib/completions/webmitm.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "webmitm -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/wget.exp b/test/lib/completions/wget.exp new file mode 100644 index 00000000..245b27be --- /dev/null +++ b/test/lib/completions/wget.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "wget --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/who.exp b/test/lib/completions/who.exp new file mode 100644 index 00000000..be3ed288 --- /dev/null +++ b/test/lib/completions/who.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "who --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/withlist.exp b/test/lib/completions/withlist.exp new file mode 100644 index 00000000..6310466d --- /dev/null +++ b/test/lib/completions/withlist.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "withlist --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/wvdial.exp b/test/lib/completions/wvdial.exp new file mode 100644 index 00000000..8d4669de --- /dev/null +++ b/test/lib/completions/wvdial.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "wvdial -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/xmms.exp b/test/lib/completions/xmms.exp new file mode 100644 index 00000000..c4ad64e8 --- /dev/null +++ b/test/lib/completions/xmms.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xmms --" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/xpovray.exp b/test/lib/completions/xpovray.exp new file mode 100644 index 00000000..92cc903d --- /dev/null +++ b/test/lib/completions/xpovray.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xpovray " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/xvnc4viewer.exp b/test/lib/completions/xvnc4viewer.exp index 1aba5fcd..3456c3e7 100644 --- a/test/lib/completions/xvnc4viewer.exp +++ b/test/lib/completions/xvnc4viewer.exp @@ -28,29 +28,15 @@ assert_complete $options {vncviewer -} sync_after_int -set test "-PreferredEncoding should show encodings" - # Try completion -set cmd "xvnc4viewer -PreferredEncoding " -send "$cmd\t" -expect { - -re "^$cmd\r\nhextile\\s+raw\\s+zrle\\s+/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +set expected {hextile raw zrle} +assert_complete $expected "xvnc4viewer -PreferredEncoding " sync_after_int -set test "--preferredencoding should show encodings" - # Try completion -set cmd "xvnc4viewer --preferredencoding " -send "$cmd\t" -expect { - -re "^$cmd\r\nhextile\\s+raw\\s+zrle\\s+/@$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect +set expected {hextile raw zrle} +assert_complete $expected "xvnc4viewer --preferredencoding " sync_after_int diff --git a/test/lib/completions/ypcat.exp b/test/lib/completions/ypcat.exp new file mode 100644 index 00000000..f1bd0c0e --- /dev/null +++ b/test/lib/completions/ypcat.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ypcat " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/ypmatch.exp b/test/lib/completions/ypmatch.exp new file mode 100644 index 00000000..b54f86ac --- /dev/null +++ b/test/lib/completions/ypmatch.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ypmatch " + + +sync_after_int + + +teardown diff --git a/test/lib/completions/yum-arch.exp b/test/lib/completions/yum-arch.exp new file mode 100644 index 00000000..defb7bf4 --- /dev/null +++ b/test/lib/completions/yum-arch.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "yum-arch -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions/yum.exp b/test/lib/completions/yum.exp new file mode 100644 index 00000000..09d7282c --- /dev/null +++ b/test/lib/completions/yum.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "yum -" + + +sync_after_int + + +teardown diff --git a/test/lib/completions_to_review/vdir.exp b/test/lib/completions_to_review/vdir.exp deleted file mode 100644 index 075317dd..00000000 --- a/test/lib/completions_to_review/vdir.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vdir --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgcfgbackup.exp b/test/lib/completions_to_review/vgcfgbackup.exp deleted file mode 100644 index 01c3c805..00000000 --- a/test/lib/completions_to_review/vgcfgbackup.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgcfgbackup --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgcfgrestore.exp b/test/lib/completions_to_review/vgcfgrestore.exp deleted file mode 100644 index 5b955ea5..00000000 --- a/test/lib/completions_to_review/vgcfgrestore.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgcfgrestore --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgchange.exp b/test/lib/completions_to_review/vgchange.exp deleted file mode 100644 index aa9ea75b..00000000 --- a/test/lib/completions_to_review/vgchange.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgchange --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgck.exp b/test/lib/completions_to_review/vgck.exp deleted file mode 100644 index c0ca185a..00000000 --- a/test/lib/completions_to_review/vgck.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgck --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgconvert.exp b/test/lib/completions_to_review/vgconvert.exp deleted file mode 100644 index 78a69f7a..00000000 --- a/test/lib/completions_to_review/vgconvert.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgconvert --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgcreate.exp b/test/lib/completions_to_review/vgcreate.exp deleted file mode 100644 index b480dc49..00000000 --- a/test/lib/completions_to_review/vgcreate.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgcreate --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgdisplay.exp b/test/lib/completions_to_review/vgdisplay.exp deleted file mode 100644 index b3768148..00000000 --- a/test/lib/completions_to_review/vgdisplay.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgdisplay --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgexport.exp b/test/lib/completions_to_review/vgexport.exp deleted file mode 100644 index 412229b0..00000000 --- a/test/lib/completions_to_review/vgexport.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgexport --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgextend.exp b/test/lib/completions_to_review/vgextend.exp deleted file mode 100644 index 1f76fb7c..00000000 --- a/test/lib/completions_to_review/vgextend.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgextend --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgimport.exp b/test/lib/completions_to_review/vgimport.exp deleted file mode 100644 index a15c8bb9..00000000 --- a/test/lib/completions_to_review/vgimport.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgimport --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgmerge.exp b/test/lib/completions_to_review/vgmerge.exp deleted file mode 100644 index 7aca79ff..00000000 --- a/test/lib/completions_to_review/vgmerge.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgmerge --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgmknodes.exp b/test/lib/completions_to_review/vgmknodes.exp deleted file mode 100644 index 626546df..00000000 --- a/test/lib/completions_to_review/vgmknodes.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgmknodes --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgreduce.exp b/test/lib/completions_to_review/vgreduce.exp deleted file mode 100644 index f4a2f548..00000000 --- a/test/lib/completions_to_review/vgreduce.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgreduce --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgremove.exp b/test/lib/completions_to_review/vgremove.exp deleted file mode 100644 index 80854314..00000000 --- a/test/lib/completions_to_review/vgremove.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgremove --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgrename.exp b/test/lib/completions_to_review/vgrename.exp deleted file mode 100644 index 86ac4ff6..00000000 --- a/test/lib/completions_to_review/vgrename.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgrename --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgs.exp b/test/lib/completions_to_review/vgs.exp deleted file mode 100644 index 0f5842c6..00000000 --- a/test/lib/completions_to_review/vgs.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgs --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgscan.exp b/test/lib/completions_to_review/vgscan.exp deleted file mode 100644 index 47208d4a..00000000 --- a/test/lib/completions_to_review/vgscan.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgscan --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/vgsplit.exp b/test/lib/completions_to_review/vgsplit.exp deleted file mode 100644 index 9383940f..00000000 --- a/test/lib/completions_to_review/vgsplit.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "vgsplit --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/wc.exp b/test/lib/completions_to_review/wc.exp deleted file mode 100644 index 476a0886..00000000 --- a/test/lib/completions_to_review/wc.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "wc --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/webmitm.exp b/test/lib/completions_to_review/webmitm.exp deleted file mode 100644 index 77ed3a2e..00000000 --- a/test/lib/completions_to_review/webmitm.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "webmitm -" -send "$cmd\t" -expect { - -re "^${cmd}d $" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/wget.exp b/test/lib/completions_to_review/wget.exp deleted file mode 100644 index d9aa1f9c..00000000 --- a/test/lib/completions_to_review/wget.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "wget " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/who.exp b/test/lib/completions_to_review/who.exp deleted file mode 100644 index 0653e63c..00000000 --- a/test/lib/completions_to_review/who.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "who " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/withlist.exp b/test/lib/completions_to_review/withlist.exp deleted file mode 100644 index 6c0bc94b..00000000 --- a/test/lib/completions_to_review/withlist.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "withlist --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/wvdial.exp b/test/lib/completions_to_review/wvdial.exp deleted file mode 100644 index 5448a536..00000000 --- a/test/lib/completions_to_review/wvdial.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "wvdial --config " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/xmms.exp b/test/lib/completions_to_review/xmms.exp deleted file mode 100644 index 67bcd6c4..00000000 --- a/test/lib/completions_to_review/xmms.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "xmms --" -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/xpovray.exp b/test/lib/completions_to_review/xpovray.exp deleted file mode 100644 index 084f61e8..00000000 --- a/test/lib/completions_to_review/xpovray.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "xpovray " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ypcat.exp b/test/lib/completions_to_review/ypcat.exp deleted file mode 100644 index 14086a82..00000000 --- a/test/lib/completions_to_review/ypcat.exp +++ /dev/null @@ -1,27 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ypcat " -send "$cmd\t" -expect { - -re "^${cmd}bash: ypcat: command not found\r\n$" { pass "$test" } - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/ypmatch.exp b/test/lib/completions_to_review/ypmatch.exp deleted file mode 100644 index 675a0566..00000000 --- a/test/lib/completions_to_review/ypmatch.exp +++ /dev/null @@ -1,27 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "ypmatch foo " -send "$cmd\t" -expect { - -re "^${cmd}bash: ypcat: command not found\r\n$" { pass "$test" } - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/yum-arch.exp b/test/lib/completions_to_review/yum-arch.exp deleted file mode 100644 index d3a82b4b..00000000 --- a/test/lib/completions_to_review/yum-arch.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "yum-arch " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown diff --git a/test/lib/completions_to_review/yum.exp b/test/lib/completions_to_review/yum.exp deleted file mode 100644 index 68bcd3fe..00000000 --- a/test/lib/completions_to_review/yum.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { -}; # setup() - - -proc teardown {} { -}; # teardown() - - -setup - - -set test "Tab should complete" - # Try completion -set cmd "yum " -send "$cmd\t" -expect { - -re "^$cmd\r\n.*$cmd$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - -re eof { unresolved "eof" } -}; # expect - - -sync_after_int - - -teardown From dcc30c71c2186ea0c77c2cfe6b9bf3a998a47e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 5 Aug 2009 23:47:15 +0300 Subject: [PATCH 41/69] Add *.ogv to xine-based players (Debian: #540033). --- CHANGES | 1 + bash_completion | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 42dd7581..620fa6f3 100644 --- a/CHANGES +++ b/CHANGES @@ -98,6 +98,7 @@ bash-completion (1.x) * Add lzcat and unlzma completion. * Load "modules" completion if /etc/profile.d/modules.sh exists even if the "module" alias has not been defined (yet). + * Add *.ogv to xine-based players (Debian: #540033). [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/bash_completion b/bash_completion index 61142ab4..38fd378a 100644 --- a/bash_completion +++ b/bash_completion @@ -122,7 +122,7 @@ complete -f -X '!*.@(?(e)ps|?(E)PS|pdf|PDF)' ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 p complete -f -X '!*.texi*' makeinfo texi2html complete -f -X '!*.@(?(la)tex|?(LA)TEX|texi|TEXI|dtx|DTX|ins|INS)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi complete -f -X '!*.@(mp3|MP3)' mpg123 mpg321 madplay -complete -f -X '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|ogg|OGG|ogm|OGM|wav|WAV|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))' xine aaxine fbxine kaffeine +complete -f -X '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|wav|WAV|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))' xine aaxine fbxine kaffeine complete -f -X '!*.@(avi|asf|wmv)' aviplay complete -f -X '!*.@(rm?(j)|ra?(m)|smi?(l))' realplay complete -f -X '!*.@(mpg|mpeg|avi|mov|qt)' xanim From 466fc03e28a6f0e24f5f1d9f196235731e3f6424 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Tue, 11 Aug 2009 21:07:06 +0200 Subject: [PATCH 42/69] Add generate script for completion tests --- test/generate | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 test/generate diff --git a/test/generate b/test/generate new file mode 100755 index 00000000..5c184d56 --- /dev/null +++ b/test/generate @@ -0,0 +1,68 @@ +#!/bin/bash -eu +# Generate skeleton files for completion of specified command. +# Test skeleton files are generated as well. +# @param $1 string Command, e.g. 'make' +# @param $2 string Completion function, e.g. _command +# @param $3 string Completion arguments, e.g. '-o filenames' + + +# Generate test code +# @param $1 string Command, e.g. 'make' +generate_test_completion() { + local path="completion/$1.exp" + # Does file already exist? + #if [ ! -f "$path" ]; then + # No, file doesn't exist; generate file + cat < "$path" +if {[assert_bash_type $1]} { + source "lib/completions/$1.exp" +}; # if +EXPECT + #fi +} # generate_test_completion() + + +# Generate test code +# @param $1 string Command, e.g. 'make' +# @param $2 string Completion function, e.g. _command +# @param $3 string Completion arguments, e.g. ' -o filenames' +generate_test_lib_completions() { + local path="lib/completions/$1.exp" + # Does file already exist? + #if [ ! -f "$path" ]; then + # No, file doesn't exist; generate file + cat < "$path" +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "$1 " + + +sync_after_int + + +teardown +EXPECT + #fi +} # generate_test_lib_completions() + + + # If argument count is wrong, show help +if [ $# -ne 1 ]; then + echo "Usage: $0 command" + echo "Example: $0 make" + exit 1 +fi + +generate_test_completion "$1" +generate_test_lib_completions "$1" From ce5384234cc48d523e26f13b1e62d63a725cbcdc Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Tue, 11 Aug 2009 21:08:25 +0200 Subject: [PATCH 43/69] Fixed _known_hosts_real indentation --- bash_completion | 125 ++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 63 deletions(-) diff --git a/bash_completion b/bash_completion index 61142ab4..395f4c45 100644 --- a/bash_completion +++ b/bash_completion @@ -1152,76 +1152,75 @@ _known_hosts_real() # If we have known_hosts files to use if [ ${#kh[@]} -gt 0 -o ${#khd[@]} -gt 0 -o -n "$configfile" ]; then - # Escape slashes and dots in paths for awk - awkcur=${cur//\//\\\/} - awkcur=${awkcur//\./\\\.} - curd=$awkcur + # Escape slashes and dots in paths for awk + awkcur=${cur//\//\\\/} + awkcur=${awkcur//\./\\\.} + curd=$awkcur - if [[ "$awkcur" == [0-9]*.* ]]; then - # Digits followed by a dot - just search for that - awkcur="^$awkcur.*" - elif [[ "$awkcur" == [0-9]* ]]; then - # Digits followed by no dot - search for digits followed - # by a dot - awkcur="^$awkcur.*\." - elif [ -z "$awkcur" ]; then - # A blank - search for a dot or an alpha character - awkcur="[a-z.]" - else - awkcur="^$awkcur" - fi + if [[ "$awkcur" == [0-9]*.* ]]; then + # Digits followed by a dot - just search for that + awkcur="^$awkcur.*" + elif [[ "$awkcur" == [0-9]* ]]; then + # Digits followed by no dot - search for digits followed + # by a dot + awkcur="^$awkcur.*\." + elif [ -z "$awkcur" ]; then + # A blank - search for a dot or an alpha character + awkcur="[a-z.]" + else + awkcur="^$awkcur" + fi - if [ ${#kh[@]} -gt 0 ]; then - - # FS needs to look for a comma separated list - COMPREPLY=( $( awk 'BEGIN {FS=","} + if [ ${#kh[@]} -gt 0 ]; then + # FS needs to look for a comma separated list + COMPREPLY=( $( awk 'BEGIN {FS=","} /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \ gsub(" .*$", "", $i); \ if ($i ~ /'$awkcur'/) {print $i} \ }}' "${kh[@]}" 2>/dev/null ) ) - fi - if [ ${#khd[@]} -gt 0 ]; then - # Needs to look for files called - # .../.ssh2/key_22_.pub - # dont fork any processes, because in a cluster environment, - # there can be hundreds of hostkeys - for i in "${khd[@]}" ; do - if [[ "$i" == *key_22_$awkcurd*.pub ]] && [ -r "$i" ] ; then - host=${i/#*key_22_/} - host=${host/%.pub/} - COMPREPLY=( "${COMPREPLY[@]}" $host ) - fi + fi + if [ ${#khd[@]} -gt 0 ]; then + # Needs to look for files called + # .../.ssh2/key_22_.pub + # dont fork any processes, because in a cluster environment, + # there can be hundreds of hostkeys + for i in "${khd[@]}" ; do + if [[ "$i" == *key_22_$awkcurd*.pub ]] && [ -r "$i" ] ; then + host=${i/#*key_22_/} + host=${host/%.pub/} + COMPREPLY=( "${COMPREPLY[@]}" $host ) + fi + done + fi + # append any available aliases from config files + if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then + local host_aliases=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\+\([^#*?]*\)\(#.*\)\?$/\2/p' "${config[@]}" ) + hosts=$( compgen -W "$host_aliases" -- $cur ) + COMPREPLY=( "${COMPREPLY[@]}" $hosts ) + fi + + # Add hosts reported by avahi, if it's available + # and if the daemon is started. + # The original call to avahi-browse also had "-k", to avoid + # lookups into avahi's services DB. We don't need the name + # of the service, and if it contains ";", it may mistify + # the result. But on Gentoo (at least), -k isn't available + # (even if mentioned in the manpage), so... + if type avahi-browse >&/dev/null; then + if [ -n "$(pidof avahi-daemon)" ]; then + COMPREPLY=( "${COMPREPLY[@]}" $( + compgen -W "$( avahi-browse -cpr _workstation._tcp | \ + grep ^= | cut -d\; -f7 | sort -u )" -- $cur ) ) + fi + fi + + # Now add results of normal hostname completion + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -A hostname -- $cur ) ) + + # apply suffix and prefix + for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do + COMPREPLY[i]=$prefix$user${COMPREPLY[i]}$suffix done - fi - # append any available aliases from config files - if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then - local host_aliases=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\+\([^#*?]*\)\(#.*\)\?$/\2/p' "${config[@]}" ) - hosts=$( compgen -W "$host_aliases" -- $cur ) - COMPREPLY=( "${COMPREPLY[@]}" $hosts ) - fi - - # Add hosts reported by avahi, if it's available - # and if the daemon is started. - # The original call to avahi-browse also had "-k", to avoid - # lookups into avahi's services DB. We don't need the name - # of the service, and if it contains ";", it may mistify - # the result. But on Gentoo (at least), -k isn't available - # (even if mentioned in the manpage), so... - if type avahi-browse >&/dev/null; then - if [ -n "$(pidof avahi-daemon)" ]; then - COMPREPLY=( "${COMPREPLY[@]}" $( - compgen -W "$( avahi-browse -cpr _workstation._tcp | \ - grep ^= | cut -d\; -f7 | sort -u )" -- $cur ) ) - fi - fi - - # Now add results of normal hostname completion - COMPREPLY=( "${COMPREPLY[@]}" $( compgen -A hostname -- $cur ) ) - - # apply suffix and prefix - for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do - COMPREPLY[i]=$prefix$user${COMPREPLY[i]}$suffix - done elif [ -z "$configfile" ]; then # Just do normal hostname completion COMPREPLY=( $( compgen -A hostname -S "$suffix" -- $cur ) ) From 2e87bd4c01a56e9752b24e15c82ffd4e9f7634a3 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Wed, 12 Aug 2009 22:20:56 +0200 Subject: [PATCH 44/69] 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 --- CHANGES | 3 ++ bash_completion | 12 ++--- doc/bash_completion.txt | 34 ++++++++++++++ doc/html~/main.html | 80 +++++++++++++++++++++++---------- doc/main.txt | 2 +- doc/makeHtml.sh | 2 +- doc/testing.txt | 2 +- test/config/bashrc | 8 ++++ test/unit/_known_hosts_real.exp | 51 +++++++++++++++++++++ 9 files changed, 162 insertions(+), 32 deletions(-) create mode 100644 doc/bash_completion.txt diff --git a/CHANGES b/CHANGES index 620fa6f3..7de6a609 100644 --- a/CHANGES +++ b/CHANGES @@ -143,6 +143,9 @@ bash-completion (1.x) * Patched _known_hosts() to support multiple {Global,User}KnownHosts in SSH config files, thanks to Thomas Nilsson (Alioth: #311595) (Debian: #524190) * Fix leaking $i from info, man and python completions. + * Added setting COMP_KNOWN_HOSTS_WITH_HOSTFILE. _known_hosts_real() will add + hosts from HOSTFILE, unless COMP_KNOWN_HOSTS_WITH_HOSTFILE is set to an + empty value (Alioth: #311821) -- David Paleino Thu, 18 Jun 2009 13:12:36 +0200 diff --git a/bash_completion b/bash_completion index ef345105..ec4e070f 100644 --- a/bash_completion +++ b/bash_completion @@ -1214,16 +1214,16 @@ _known_hosts_real() fi fi - # Now add results of normal hostname completion - COMPREPLY=( "${COMPREPLY[@]}" $( compgen -A hostname -- $cur ) ) - # apply suffix and prefix for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do COMPREPLY[i]=$prefix$user${COMPREPLY[i]}$suffix done - elif [ -z "$configfile" ]; then - # Just do normal hostname completion - COMPREPLY=( $( compgen -A hostname -S "$suffix" -- $cur ) ) + fi + + # Add results of normal hostname completion, unless `COMP_KNOWN_HOSTS_WITH_HOSTFILE' + # is set to an empty value. + if [ -n "${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1}" ]; then + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -A hostname -P "$prefix$user" -S "$suffix" -- $cur ) ) fi return 0 diff --git a/doc/bash_completion.txt b/doc/bash_completion.txt new file mode 100644 index 00000000..c7e7a2b9 --- /dev/null +++ b/doc/bash_completion.txt @@ -0,0 +1,34 @@ +Bash completion +=============== + +Environment variables +--------------------- + +*COMP_CONFIGURE_HINTS*:: + If set and not null, `configure` completion will return the entire option + string (e.g. `--this-option=DESCRIPTION`) so one can see what kind of data + is required and then simply delete the descriptive text and add one's own + data. If unset or null (default), `configure` completion will strip + everything after the '=' when returning completions. + + +*COMP_CVS_REMOTE*:: + If set and not null, `cvs commit` completion will try to complete on + remotely checked-out files. This requires passwordless access to the + remote repository. Default is unset. + + +*COMP_KNOWN_HOSTS_WITH_HOSTFILE*:: + If set and not null (default), known_hosts completion will complement + hostnames from ssh's known_hosts_files with hostnames taken from the file + specified by the HOSTFILE shell variable (compgen -A hostname). If null, + known_hosts completion will omit hostnames from HOSTFILE. Omitting + hostnames from HOSTFILE is useful if HOSTFILE contains many entries for + local web development or ad-blocking. + + +*COMP_TAR_INTERNAL_PATHS*:: + If set and not null *before* sourcing bash_completion, `tar` completion + will do correct path completion for tar file contents. If unset or null, + `tar' completion will do correct completion for paths to tar files. See + also README. diff --git a/doc/html~/main.html b/doc/html~/main.html index adbd0c51..86ce6d81 100644 --- a/doc/html~/main.html +++ b/doc/html~/main.html @@ -1,9 +1,39 @@ -Bash-completion

Bash-completion

Freddy Vulto (FVu)

Revision History
Revision 1.0Mar 2009FV(

Preface

Bash completion extends bashs standard completion behavior to achieve +Bash-completion

Bash-completion

Freddy Vulto (FVu)

Revision History
Revision 1.0Mar 2009FV(

Preface

Bash completion extends bashs standard completion behavior to achieve complex command lines with just a few keystrokes. This project was conceived to produce programmable completion routines for the most common Linux/UNIX commands, reducing the amount of typing sysadmins -and programmers need to do on a daily basis.

Part I. Coding Style Guide

Table of Contents

1. Introduction

Chapter 1. Introduction

This document attempts to explain the basic styles and patterns that are used in the bash completion. New code should try to conform to these standards so that it is as easy to maintain as existing code. Of course every rule has an exception, but it's important to know the rules nonetheless!

This is particularly directed at people new to the bash completion codebase, who are in the process of getting their code reviewed. Before getting a review, please read over this document and make sure your code conforms to the recommendations here.

Part II. Automated testing

Chapter 2. Introduction

The bash-completion package contains an automated test suite. Running the tests should help verifying that bash-completion works as expected. The tests are also very helpful in uncovering software regressions at an early stage.

The bash-completion test suite is written on top of the DejaGnu testing framework. DejaGnu is written in Expect, which in turn uses Tcl — Tool command language.

Chapter 3. Installing DejaGnu

Table of Contents

3.1. Debian/Ubuntu

Installing DejaGnu should be easy using your local package manager.

3.1. Debian/Ubuntu

On Debian/Ubuntu you can use apt-get:

sudo apt-get install dejagnu

This should also install the necessary expect and tcl packages.

Chapter 4. Structure

4.1. Main areas (DejaGnu tools)

The tests are grouped into different areas, called tool in DejaGnu:

+and programmers need to do on a daily basis.

Part I. Bash completion

Table of Contents

1. Environment variables

Chapter 1. Environment variables

+COMP_CONFIGURE_HINTS +
+ If set and not null, configure completion will return the entire option + string (e.g. --this-option=DESCRIPTION) so one can see what kind of data + is required and then simply delete the descriptive text and add one’s own + data. If unset or null (default), configure completion will strip + everything after the = when returning completions. +
+COMP_CVS_REMOTE +
+ If set and not null, cvs commit completion will try to complete on + remotely checked-out files. This requires passwordless access to the + remote repository. Default is unset. +
+COMP_KNOWN_HOSTS_WITH_HOSTFILE +
+ If set and not null (default), known_hosts completion will complement + hostnames from ssh’s known_hosts_files with hostnames taken from the file + specified by the HOSTFILE shell variable (compgen -A hostname). If null, + known_hosts completion will omit hostnames from HOSTFILE. Omitting + hostnames from HOSTFILE is useful if HOSTFILE contains many entries for + local web development or ad-blocking. +
+COMP_TAR_INTERNAL_PATHS +
+ If set and not null before sourcing bash_completion, ‘tar` completion + will do correct path completion for tar file contents. If unset or null, + `tar’ completion will do correct completion for paths to tar files. See + also README. +

Part II. Coding Style Guide

Table of Contents

2. Introduction

Chapter 2. Introduction

This document attempts to explain the basic styles and patterns that are used in the bash completion. New code should try to conform to these standards so that it is as easy to maintain as existing code. Of course every rule has an exception, but it’s important to know the rules nonetheless!

This is particularly directed at people new to the bash completion codebase, who are in the process of getting their code reviewed. Before getting a review, please read over this document and make sure your code conforms to the recommendations here.

Part III. Automated testing

Chapter 3. Introduction

The bash-completion package contains an automated test suite. Running the tests should help verifying that bash-completion works as expected. The tests are also very helpful in uncovering software regressions at an early stage.

The bash-completion test suite is written on top of the DejaGnu testing framework. DejaGnu is written in Expect, which in turn uses Tcl — Tool command language.

Chapter 4. Installing DejaGnu

Table of Contents

4.1. Debian/Ubuntu

Installing DejaGnu should be easy using your local package manager.

4.1. Debian/Ubuntu

On Debian/Ubuntu you can use apt-get:

sudo apt-get install dejagnu

This should also install the necessary expect and tcl packages.

Chapter 5. Structure

5.1. Main areas (DejaGnu tools)

The tests are grouped into different areas, called tool in DejaGnu:

completion
Functional tests per completion. @@ -15,11 +45,11 @@ and programmers need to do on a daily basis.

unit
Unit tests for bash-completion helper functions. -

Each tool has a slightly different way of loading the test fixtures, see Test context below.

4.2. Running the tests

The tests are run by calling runtest in the test directory:

runtest --outdir log --tool completion
+

Each tool has a slightly different way of loading the test fixtures, see Test context below.

5.2. Running the tests

The tests are run by calling runtest in the test directory:

runtest --outdir log --tool completion
 runtest --outdir log --tool install
 runtest --outdir log --tool unit

The commands above are already wrapped up in shell scripts within the test directory:

./runCompletion
 ./runInstall
-./runUnit

Chapter 5. Maintenance

5.1. Adding a completion test

You can add script/generate to add a test.

5.2. Fixing a completion test

Let's consider this real-life example where an ssh completion bug is fixed. First you're triggered by unsuccessful tests:

$ ./runCompletion
+./runUnit

Chapter 6. Maintenance

6.1. Adding a completion test

You can run cd test && ./generate to add a test.

6.2. Fixing a completion test

Let’s consider this real-life example where an ssh completion bug is fixed. First you’re triggered by unsuccessful tests:

$ ./runCompletion
 ...
                 === completion Summary ===
 
@@ -28,41 +58,41 @@ runtest --outdir log --tool unit

The commands above are already wrapped # of unresolved testcases 2 # of unsupported tests 47

Take a look in log/completion.log to find out which specific command is failing.

$ vi log/completion.log

Search for UNRESOLVED or FAIL. From there scroll up to see which .exp test is failing:

/@Running ./completion/ssh.exp ...
 ...
-UNRESOLVED: Tab should complete ssh known-hosts at prompt

In this case it appears ssh.exp is causing the problem. Isolate the ssh tests by specifying just ssh.exp to run. Furthermore add the —debug flag, so output gets logged in dbg.log:

$ ./runCompletion ssh.exp --debug
+UNRESOLVED: Tab should complete ssh known-hosts at prompt

In this case it appears ssh.exp is causing the problem. Isolate the ssh tests by specifying just ssh.exp to run. Furthermore add the --debug flag, so output gets logged in dbg.log:

$ ./runCompletion ssh.exp --debug
 ...
                 === completion Summary ===
 
 # of expected passes            1
-# of unresolved testcases       1

Now we can have a detailed look in dbg.log to find out what's going wrong. Open dbg.log and search for UNRESOLVED (or FAIL if that's what you're looking for):

UNRESOLVED: Tab should complete ssh known-hosts at prompt

From there, search up for the first line saying:

expect: does "..." match regular expression "..."

This tells you where the actual output differs from the expected output. In this case it looks like the test "ssh -F fixtures/ssh/config <TAB>" is expecting just hostnames, whereas the actual completion is containing commands - but no hostnames. -So what should be expected after "ssh -F fixtures/ssh/config <TAB>" are both commands and hostnames. This means both the test and the completion need fixing. Let's start with the test.

$ vi lib/completions/ssh.exp

Search for the test "Tab should complete ssh known-hosts". Here you could've seen that what was expected were hostnames ($hosts):

set expected "^$cmd\r\n$hosts\r\n/@$cmd$"

Adding all commands (which could well be over 2000) to expected, seems a bit overdone so we're gonna change things here. Lets expect the unit test for _known_hosts assures all hosts are returned. Then all we need to do here is expect one host and one command, just to be kind of sure that both hosts and commands are completed.

Looking in the fixture for ssh:

$ vi fixtures/ssh/known_hosts

it looks like we can add an additional host ls_known_host. Now if we would perform the test "ssh -F fixtures/ssh/config ls<TAB>" both the command ls and the host ls_known_host should come up. Let's modify the test so:

$ vi lib/completions/ssh.exp
+# of unresolved testcases       1

Now we can have a detailed look in dbg.log to find out what’s going wrong. Open dbg.log and search for UNRESOLVED (or FAIL if that’s what you’re looking for):

UNRESOLVED: Tab should complete ssh known-hosts at prompt

From there, search up for the first line saying:

expect: does "..." match regular expression "..."

This tells you where the actual output differs from the expected output. In this case it looks like the test "ssh -F fixtures/ssh/config <TAB>" is expecting just hostnames, whereas the actual completion is containing commands - but no hostnames. +So what should be expected after "ssh -F fixtures/ssh/config <TAB>" are both commands and hostnames. This means both the test and the completion need fixing. Let’s start with the test.

$ vi lib/completions/ssh.exp

Search for the test "Tab should complete ssh known-hosts". Here you could’ve seen that what was expected were hostnames ($hosts):

set expected "^$cmd\r\n$hosts\r\n/@$cmd$"

Adding all commands (which could well be over 2000) to expected, seems a bit overdone so we’re gonna change things here. Lets expect the unit test for _known_hosts assures all hosts are returned. Then all we need to do here is expect one host and one command, just to be kind of sure that both hosts and commands are completed.

Looking in the fixture for ssh:

$ vi fixtures/ssh/known_hosts

it looks like we can add an additional host ls_known_host. Now if we would perform the test "ssh -F fixtures/ssh/config ls<TAB>" both the command ls and the host ls_known_host should come up. Let’s modify the test so:

$ vi lib/completions/ssh.exp
 ...
 set expected "^$cmd\r\n.*ls.*ls_known_host.*\r\n/@$cmd$"

Running the test reveals we still have an unresolved test:

$ ./runCompletion ssh.exp --debug
 ...
                 === completion Summary ===
 
 # of expected passes            1
-# of unresolved testcases       1

But if now look into the log file dbg.log we can see the completion only returns commands starting with ls but fails to match our regular expression which also expects the hostname `ls_known_host':

$ vi dbg.log
+# of unresolved testcases       1

But if now look into the log file ‘dbg.log` we can see the completion only returns commands starting with ls but fails to match our regular expression which also expects the hostname `ls_known_host’:

$ vi dbg.log
 ...
-expect: does "ssh -F fixtures/ssh/config ls\r\nls           lsattr       lsb_release  lshal        lshw         lsmod        lsof         lspci        lspcmcia     lspgpot      lss16toppm\r\nlsusb\r\n/@ssh -F fixtures/ssh/config ls" (spawn_id exp9) match regular expression "^ssh -F fixtures/ssh/config ls\r\n.*ls.*ls_known_host.*\r\n/@ssh -F fixtures/ssh/config ls$"? no

Now let's fix ssh completion:

$ vi ../contrib/ssh
+expect: does "ssh -F fixtures/ssh/config ls\r\nls           lsattr       lsb_release  lshal        lshw         lsmod        lsof         lspci        lspcmcia     lspgpot      lss16toppm\r\nlsusb\r\n/@ssh -F fixtures/ssh/config ls" (spawn_id exp9) match regular expression "^ssh -F fixtures/ssh/config ls\r\n.*ls.*ls_known_host.*\r\n/@ssh -F fixtures/ssh/config ls$"? no

Now let’s fix ssh completion:

$ vi ../contrib/ssh
 ...

until the test shows:

$ ./runCompletion ssh.exp
 ...
                 === completion Summary ===
 
-# of expected passes            2

5.3. Fixing a unit test

Now let's consider a unit test failure. First you're triggered by unsuccessful tests:

$ ./runUnit
+# of expected passes            2

6.3. Fixing a unit test

Now let’s consider a unit test failure. First you’re triggered by unsuccessful tests:

$ ./runUnit
 ...
                 === unit Summary ===
 
 # of expected passes            1
 # of unexpected failures        1

Take a look in log/unit.log to find out which specific command is failing.

$ vi log/unit.log

Search for UNRESOLVED or FAIL. From there scroll up to see which .exp test is failing:

/@Running ./unit/_known_hosts_real.exp ...
 ...
-FAIL: Environment should stay clean

In this case it appears _known_hosts_real.exp is causing the problem. Isolate the _known_hosts_real test by specifying just _known_hosts_real.exp to run. Furthermore add the —debug flag, so output gets logged in dbg.log:

$ ./runUnit _known_hosts_real.exp --debug
+FAIL: Environment should stay clean

In this case it appears _known_hosts_real.exp is causing the problem. Isolate the _known_hosts_real test by specifying just _known_hosts_real.exp to run. Furthermore add the --debug flag, so output gets logged in dbg.log:

$ ./runUnit _known_hosts_real.exp --debug
 ...
                 === completion Summary ===
 
 # of expected passes            1
-# of unexpected failures        1

Now, if we haven't already figured out the problem, we can have a detailed look in dbg.log to find out what's going wrong. Open dbg.log and search for UNRESOLVED (or FAIL if that's what you're looking for):

FAIL: Environment should stay clean

From there, search up for the first line saying:

expect: does "..." match regular expression "..."

This tells you where the actual output differs from the expected output. In this case it looks like the the function _known_hosts_real is unexpectedly modifying global variables cur and flag. In case you need to modify the test:

$ vi lib/unit/_known_hosts_real.exp

Chapter 6. Rationale

6.1. Naming conventions

6.1.1. Test suite or testsuite

The primary Wikipedia page is called -test suite and not testsuite, so that's what this -document sticks to.

6.1.2. script/generate

The name and location of this code generation script come from Ruby on Rails' script/generate.

Chapter 7. Reference

Within test scripts the following library functions can be used:

Chapter 8. Test context

The test environment needs to be put to fixed states when testing. For instance the bash prompt (PS1) is set to the current test directory, followed by an ampersand (@). The default settings for bash reside in config/bashrc and config/inputrc.

For each tool (completion, install, unit) a slightly different context is in effect.

8.1. What happens when tests are run?

8.1.1. completion

When the completions are tested, invoking DejaGnu will result in a call to completion_start() which in turn will start bash —rcfile config/bashrc.

Example 8.1. What happens when completion tests are run?

               | runtest --tool completion
+# of unexpected failures        1

Now, if we haven’t already figured out the problem, we can have a detailed look in dbg.log to find out what’s going wrong. Open dbg.log and search for UNRESOLVED (or FAIL if that’s what you’re looking for):

FAIL: Environment should stay clean

From there, search up for the first line saying:

expect: does "..." match regular expression "..."

This tells you where the actual output differs from the expected output. In this case it looks like the the function _known_hosts_real is unexpectedly modifying global variables cur and flag. In case you need to modify the test:

$ vi lib/unit/_known_hosts_real.exp

Chapter 7. Rationale

7.1. Naming conventions

7.1.1. Test suite or testsuite

The primary Wikipedia page is called +test suite and not testsuite, so that’s what this +document sticks to.

7.1.2. script/generate

The name and location of this code generation script come from Ruby on Rails' script/generate.

Chapter 8. Reference

Within test scripts the following library functions can be used:

Chapter 9. Test context

The test environment needs to be put to fixed states when testing. For instance the bash prompt (PS1) is set to the current test directory, followed by an ampersand (@). The default settings for bash reside in config/bashrc and config/inputrc.

For each tool (completion, install, unit) a slightly different context is in effect.

9.1. What happens when tests are run?

9.1.1. completion

When the completions are tested, invoking DejaGnu will result in a call to completion_start() which in turn will start bash --rcfile config/bashrc.

Example 9.1. What happens when completion tests are run?

               | runtest --tool completion
                V
     +----------+-----------+
     |  lib/completion.exp  |
@@ -87,7 +117,7 @@ document sticks to.


Setting up bash once within completion_start() has the speed advantage that bash - and bash-completion - need only initialize once when testing multiple completions, e.g.:

    runtest --tool completion alias.exp cd.exp

8.1.2. install

Example 8.2. What happens when install tests are run?

                 | runtest --tool install
+    +----------------------+

Setting up bash once within completion_start() has the speed advantage that bash - and bash-completion - need only initialize once when testing multiple completions, e.g.:

    runtest --tool completion alias.exp cd.exp

9.1.2. install

Example 9.2. What happens when install tests are run?

                 | runtest --tool install
                  V
             +----+----+
             | DejaGnu |
@@ -101,7 +131,7 @@ document sticks to.


8.1.3. unit

Example 8.3. What happens when unit tests are run?

               | runtest --tool unit
+    +-------------------------+

9.1.3. unit

Example 9.3. What happens when unit tests are run?

               | runtest --tool unit
                V
           +----+----+
           | DejaGnu |
@@ -111,8 +141,7 @@ document sticks to.


8.2. bashrc

This is the bash configuration file (bashrc) used for testing:

-# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
+    +----------------------+

9.2. bashrc

This is the bash configuration file (bashrc) used for testing:

# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
 # ex: ts=8 sw=8 noet filetype=sh
 #
 # bashrc file for DejaGnu testsuite
@@ -134,9 +163,15 @@ export INPUTRC=$TESTDIR/config/inputrc
         # Ensure enough columns so expect doesn't have to care about line breaks
 stty columns 150
 
-. lib/library.sh
-

8.3. inputrc

This is the readline configuration file (inputrc) used for testing:

-# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
+        # Make sure default settings are in effect
+unset -v \
+    COMP_CONFIGURE_HINTS \
+    COMP_CVS_REMOTE \
+    COMP_KNOWN_HOSTS_WITH_HOSTFILE \
+    COMP_TAR_INTERNAL_PATHS
+
+        # Load bash testsuite helper functions
+. lib/library.sh

9.3. inputrc

This is the readline configuration file (inputrc) used for testing:

# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
 # ex: ts=8 sw=8 noet filetype=sh
 #
 # Readline init file for DejaGnu testsuite
@@ -151,5 +186,4 @@ set completion-query-items -1
         # Display completions sorted horizontally, not vertically
 set print-completions-horizontally on
         # Don't use pager when showing completions
-set page-completions off
-

Index

+set page-completions off

Index

diff --git a/doc/main.txt b/doc/main.txt index d9cdd822..d8a3076a 100644 --- a/doc/main.txt +++ b/doc/main.txt @@ -12,7 +12,7 @@ common Linux/UNIX commands, reducing the amount of typing sysadmins and programmers need to do on a daily basis. // include::intro.txt[] -// include::bash_completion.txt[] +include::bash_completion.txt[] include::styleguide.txt[] include::testing.txt[] diff --git a/doc/makeHtml.sh b/doc/makeHtml.sh index 8e52eff3..ed29ab40 100755 --- a/doc/makeHtml.sh +++ b/doc/makeHtml.sh @@ -1,4 +1,4 @@ #!/bin/bash -eu [ -d html~ ] || mkdir html~ -a2x -D html~ -d book -f xhtml main.txt +a2x -D html~ -d book -f xhtml --unsafe main.txt diff --git a/doc/testing.txt b/doc/testing.txt index fe415973..8ebb29d3 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -72,7 +72,7 @@ Maintenance Adding a completion test ~~~~~~~~~~~~~~~~~~~~~~~~ -You can add script/generate to add a test. +You can run `cd test && ./generate` to add a test. Fixing a completion test diff --git a/test/config/bashrc b/test/config/bashrc index 7a50f6e4..85399773 100644 --- a/test/config/bashrc +++ b/test/config/bashrc @@ -20,4 +20,12 @@ export INPUTRC=$TESTDIR/config/inputrc # Ensure enough columns so expect doesn't have to care about line breaks stty columns 150 + # Make sure default settings are in effect +unset -v \ + COMP_CONFIGURE_HINTS \ + COMP_CVS_REMOTE \ + COMP_KNOWN_HOSTS_WITH_HOSTFILE \ + COMP_TAR_INTERNAL_PATHS + + # Load bash testsuite helper functions . lib/library.sh diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp index a698b926..71966d5d 100644 --- a/test/unit/_known_hosts_real.exp +++ b/test/unit/_known_hosts_real.exp @@ -32,6 +32,32 @@ expect { sync_after_int +set test "Hosts should have username prefix and colon suffix" +set hosts [get_hosts] + # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config + # Hosts `doo' and `ike' are defined in ./fixtures/_known_hosts_real/known_hosts +lappend hosts doo gee hus ike jar +set hosts [lsort -ascii $hosts] +set expected {} +foreach host $hosts { + lappend expected "user@$host:" +}; # foreach +set expected [join $expected "\\s+"] + # Call _known_hosts +set cmd {_known_hosts_real -acF fixtures/_known_hosts_real/config 'user@'; echo_array COMPREPLY} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -re "^$expected\r\n/@$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect + + +sync_after_int + + + set test "Config file containing space should work" set hosts [get_hosts] # Hosts `gee' and `hus' are defined in ./fixtures/_known_hosts_real/spaced conf @@ -51,6 +77,31 @@ expect { }; # expect +sync_after_int + + +set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE" +assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE=" +set hosts {} + # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config + # Hosts `doo' and `ike' are defined in ./fixtures/_known_hosts_real/known_hosts +lappend hosts doo gee hus ike jar +set hosts [lsort -ascii $hosts] +set hosts [join $hosts "\\s+"] + # Call _known_hosts +set cmd {_known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -re "^$hosts\r\n/@$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect +sync_after_int +assert_bash_exec "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE" + + + sync_after_int From a1f5b2e2d0b22b02b6b633d39731e06d09294693 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Wed, 12 Aug 2009 22:28:42 +0200 Subject: [PATCH 45/69] Fix _known_hosts_real() comment --- bash_completion | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index ec4e070f..ab03d523 100644 --- a/bash_completion +++ b/bash_completion @@ -1063,8 +1063,9 @@ _known_hosts() } # Helper function for completing _known_hosts. -# This function performs host completion based on ssh's known_hosts files, -# defaulting to standard host completion if they don't exist. +# This function performs host completion based on ssh's known_hosts files. +# Also hosts from HOSTFILE (compgen -A hostname) are added, unless +# COMP_KNOWN_HOSTS_WITH_HOSTFILE is set to an empty value. # Usage: _known_hosts_real [OPTIONS] CWORD # Options: -a Use aliases # -c Use `:' suffix From 7e92537bad3f333e4320a5c9e4c15a53965c7cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 12 Aug 2009 23:49:27 +0300 Subject: [PATCH 46/69] Add $compopt (":" i.e. noop with bash < 4, "compopt" with >= 4). --- CHANGES | 1 + bash_completion | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 7de6a609..76a16444 100644 --- a/CHANGES +++ b/CHANGES @@ -99,6 +99,7 @@ bash-completion (1.x) * Load "modules" completion if /etc/profile.d/modules.sh exists even if the "module" alias has not been defined (yet). * Add *.ogv to xine-based players (Debian: #540033). + * Add $compopt (":" i.e. no-op with bash < 4, "compopt" with >= 4). [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/bash_completion b/bash_completion index ab03d523..cfccabbe 100644 --- a/bash_completion +++ b/bash_completion @@ -65,6 +65,7 @@ if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} > 04 ]] || default="-o default" dirnames="-o dirnames" filenames="-o filenames" + compopt=: fi # features supported by bash 2.05b and higher if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} = "05b" ]] || @@ -81,6 +82,7 @@ fi # features supported by bash 4.0 and higher if [ ${BASH_VERSINFO[0]} -gt 3 ]; then declare -r bash4=$BASH_VERSION 2>/dev/null || : + compopt=compopt fi # Turn on extended globbing and programmable completion @@ -1555,7 +1557,8 @@ unset i [ $BASH_COMPLETION != ~/.bash_completion -a -r ~/.bash_completion ] \ && . ~/.bash_completion unset -f have -unset UNAME USERLAND default dirnames filenames have nospace bashdefault plusdirs +unset UNAME USERLAND default dirnames filenames have nospace bashdefault \ + plusdirs compopt set $BASH_COMPLETION_ORIGINAL_V_VALUE unset BASH_COMPLETION_ORIGINAL_V_VALUE From 8c43004135249e27ca5f36a7ced455e4750e48ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 18 Aug 2009 11:15:01 +0300 Subject: [PATCH 47/69] Add lz*grep, lzless, and lzmore completion. --- CHANGES | 2 +- bash_completion | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 76a16444..b96b7896 100644 --- a/CHANGES +++ b/CHANGES @@ -95,7 +95,7 @@ bash-completion (1.x) * Add xmlwf completion. * Associate *.po with poedit, gtranslator, kbabel, and lokalize. * Add xz, xzcat, xzdec, and unxz completion. - * Add lzcat and unlzma completion. + * Add lzcat, lz*grep, lzless, lzmore, and unlzma completion. * Load "modules" completion if /etc/profile.d/modules.sh exists even if the "module" alias has not been defined (yet). * Add *.ogv to xine-based players (Debian: #540033). diff --git a/bash_completion b/bash_completion index cfccabbe..9d7c88a1 100644 --- a/bash_completion +++ b/bash_completion @@ -109,7 +109,8 @@ complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip #complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore complete -f -X '!*.*' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore complete -f -X '!*.Z' uncompress -complete -f -X '!*.lzma' lzcat unlzma +# lzcmp, lzdiff intentionally not here, see Debian: #455510 +complete -f -X '!*.lzma' lzcat lzegrep lzfgrep lzgrep lzless lzmore unlzma complete -f -X '!*.@(xz|lzma)' unxz xzcat complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' ee complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv From e074f7ff83dbcad3bd179f9c8dc1ab548e4b3017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 18 Aug 2009 11:22:16 +0300 Subject: [PATCH 48/69] Complete bzcat and zcat only on compressed files. --- CHANGES | 1 + bash_completion | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index b96b7896..b2b2928c 100644 --- a/CHANGES +++ b/CHANGES @@ -100,6 +100,7 @@ bash-completion (1.x) the "module" alias has not been defined (yet). * Add *.ogv to xine-based players (Debian: #540033). * Add $compopt (":" i.e. no-op with bash < 4, "compopt" with >= 4). + * Complete bzcat and zcat only on compressed files. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/bash_completion b/bash_completion index 9d7c88a1..4b8b125c 100644 --- a/bash_completion +++ b/bash_completion @@ -98,16 +98,16 @@ complete -d pushd # Do NOT break these over multiple lines. # # START exclude -- do NOT remove this line -complete -f -X '!*.?(t)bz?(2)' bunzip2 +complete -f -X '!*.?(t)bz?(2)' bunzip2 bzcat # TODO: see #455510 -#complete -f -X '!*.?(t)bz?(2)' bzcat bzcmp bzdiff bzegrep bzfgrep bzgrep -complete -f -X '!*.*' bzcat bzcmp bzdiff bzegrep bzfgrep bzgrep +#complete -f -X '!*.?(t)bz?(2)' bzcmp bzdiff bzegrep bzfgrep bzgrep +complete -f -X '!*.*' bzcmp bzdiff bzegrep bzfgrep bzgrep complete -f -X '!*.@(zip|ZIP|jar|JAR|exe|EXE|pk3|war|wsz|ear|zargo|xpi|sxw|ott|od[fgpst]|epub)' unzip zipinfo complete -f -X '*.Z' compress znew -complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip +complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip zcat # TODO: see #455510 -#complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore -complete -f -X '!*.*' zcmp zdiff zcat zegrep zfgrep zgrep zless zmore +#complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' zcmp zdiff zegrep zfgrep zgrep zless zmore +complete -f -X '!*.*' zcmp zdiff zegrep zfgrep zgrep zless zmore complete -f -X '!*.Z' uncompress # lzcmp, lzdiff intentionally not here, see Debian: #455510 complete -f -X '!*.lzma' lzcat lzegrep lzfgrep lzgrep lzless lzmore unlzma From 405e33deed75a3967c092cca37d7b94686403dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 18 Aug 2009 11:31:39 +0300 Subject: [PATCH 49/69] Do not require a dot in bzcmp, bzdiff, bz*grep, zcmp, zdiff, z*grep, zless, and zmore filename completions. --- CHANGES | 2 ++ bash_completion | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index b2b2928c..5313884a 100644 --- a/CHANGES +++ b/CHANGES @@ -101,6 +101,8 @@ bash-completion (1.x) * Add *.ogv to xine-based players (Debian: #540033). * Add $compopt (":" i.e. no-op with bash < 4, "compopt" with >= 4). * Complete bzcat and zcat only on compressed files. + * Do not require a dot in bzcmp, bzdiff, bz*grep, zcmp, zdiff, z*grep, zless, + and zmore filename completions. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/bash_completion b/bash_completion index 4b8b125c..269595de 100644 --- a/bash_completion +++ b/bash_completion @@ -99,15 +99,11 @@ complete -d pushd # # START exclude -- do NOT remove this line complete -f -X '!*.?(t)bz?(2)' bunzip2 bzcat -# TODO: see #455510 -#complete -f -X '!*.?(t)bz?(2)' bzcmp bzdiff bzegrep bzfgrep bzgrep -complete -f -X '!*.*' bzcmp bzdiff bzegrep bzfgrep bzgrep +# bzcmp, bzdiff, bz*grep intentionally not here, see Debian: #455510 complete -f -X '!*.@(zip|ZIP|jar|JAR|exe|EXE|pk3|war|wsz|ear|zargo|xpi|sxw|ott|od[fgpst]|epub)' unzip zipinfo complete -f -X '*.Z' compress znew complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip zcat -# TODO: see #455510 -#complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' zcmp zdiff zegrep zfgrep zgrep zless zmore -complete -f -X '!*.*' zcmp zdiff zegrep zfgrep zgrep zless zmore +# zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510 complete -f -X '!*.Z' uncompress # lzcmp, lzdiff intentionally not here, see Debian: #455510 complete -f -X '!*.lzma' lzcat lzegrep lzfgrep lzgrep lzless lzmore unlzma From 1ed4fa2f6241aa6a411edd8b1d0fa339f2d12a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 18 Aug 2009 11:45:47 +0300 Subject: [PATCH 50/69] Comment tweaks. --- bash_completion | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index 269595de..96217d7b 100644 --- a/bash_completion +++ b/bash_completion @@ -98,12 +98,12 @@ complete -d pushd # Do NOT break these over multiple lines. # # START exclude -- do NOT remove this line +# bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510 complete -f -X '!*.?(t)bz?(2)' bunzip2 bzcat -# bzcmp, bzdiff, bz*grep intentionally not here, see Debian: #455510 complete -f -X '!*.@(zip|ZIP|jar|JAR|exe|EXE|pk3|war|wsz|ear|zargo|xpi|sxw|ott|od[fgpst]|epub)' unzip zipinfo complete -f -X '*.Z' compress znew -complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip zcat # zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510 +complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip zcat complete -f -X '!*.Z' uncompress # lzcmp, lzdiff intentionally not here, see Debian: #455510 complete -f -X '!*.lzma' lzcat lzegrep lzfgrep lzgrep lzless lzmore unlzma From 9af88e6bd44c26b574869bb9f7ffb52fae7fd2fe Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Tue, 18 Aug 2009 21:28:43 +0200 Subject: [PATCH 51/69] Fix unit test _known_hosts_real Test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE" now includes hosts reported by avahi. --- test/lib/library.exp | 18 +++++++++++++----- test/unit/_known_hosts_real.exp | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/test/lib/library.exp b/test/lib/library.exp index 3299ccba..b663d3f4 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -274,13 +274,10 @@ proc assert_exec {cmd {stdout ''} {test ''}} { # @return list Hostnames proc get_hosts {} { set hosts [exec bash -c "compgen -A hostname"] - # NOTE: Circumenventing `avahi_host' and appending directly to `hosts' + # NOTE: Circumventing var `avahi_hosts' and appending directly to `hosts' # causes an empty element to be inserted in `hosts'. # -- FVu, Fri Jul 17 23:11:46 CEST 2009 - set avahi_hosts [exec bash -c { - type avahi-browse >&/dev/null && [ -n "$(pidof avahi-daemon)" ] - avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u - }] + set avahi_hosts [get_hosts_avahi] if {[llength $avahi_hosts] > 0} { lappend hosts $avahi_hosts }; # if @@ -288,6 +285,17 @@ proc get_hosts {} { }; # get_hosts() +# Get hostnames according to avahi +# @return list Hostnames +proc get_hosts_avahi {} { + set hosts [exec bash -c { + type avahi-browse >&/dev/null && [ -n "$(pidof avahi-daemon)" ] + avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u + }] + return $hosts +}; # get_hosts_avahi() + + # Get signals # This function is written in analogy to the bash function `_signals()' in # `bash_completion'. diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp index 71966d5d..94fc67ee 100644 --- a/test/unit/_known_hosts_real.exp +++ b/test/unit/_known_hosts_real.exp @@ -82,7 +82,7 @@ sync_after_int set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE" assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE=" -set hosts {} +set hosts [get_hosts_avahi] # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config # Hosts `doo' and `ike' are defined in ./fixtures/_known_hosts_real/known_hosts lappend hosts doo gee hus ike jar From 31f03cfb82cfe528d987f8c3d6375da5306b4973 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sun, 23 Aug 2009 09:38:19 +0200 Subject: [PATCH 52/69] 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 --- bash_completion | 4 ++-- test/fixtures/_known_hosts_real/known*hosts | 2 ++ test/fixtures/_known_hosts_real/known*hosts2 | 1 + test/fixtures/_known_hosts_real/star*conf | 2 ++ test/lib/library.exp | 25 +++++++++++++++++++- test/unit/_known_hosts_real.exp | 12 +++++++++- 6 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 test/fixtures/_known_hosts_real/known*hosts create mode 100644 test/fixtures/_known_hosts_real/known*hosts2 create mode 100644 test/fixtures/_known_hosts_real/star*conf diff --git a/bash_completion b/bash_completion index 96217d7b..806dacf5 100644 --- a/bash_completion +++ b/bash_completion @@ -1110,12 +1110,12 @@ _known_hosts_real() if [ ${#config[@]} -gt 0 ]; then local OIFS=$IFS IFS=$'\n' # expand path (if present) to global known hosts file - global_kh=($( sed -ne 's/^[ \t]*[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" )) + global_kh=($( sed -ne 's/^[ \t]*[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/"\1"/p' "${config[@]}" )) for (( i=0; i < ${#global_kh[@]}; i++ )); do global_kh[i]=$(echo "${global_kh[i]//\"/}") done # expand path (if present) to user known hosts file - user_kh=($( sed -ne 's/^[ \t]*[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" )) + user_kh=($( sed -ne 's/^[ \t]*[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/"\1"/p' "${config[@]}" )) for (( i=0; i < ${#user_kh[@]}; i++ )); do user_kh[i]=$(echo "${user_kh[i]//\"/}") done diff --git a/test/fixtures/_known_hosts_real/known*hosts b/test/fixtures/_known_hosts_real/known*hosts new file mode 100644 index 00000000..5db11437 --- /dev/null +++ b/test/fixtures/_known_hosts_real/known*hosts @@ -0,0 +1,2 @@ +star*d +tra,10.0.0.0 key diff --git a/test/fixtures/_known_hosts_real/known*hosts2 b/test/fixtures/_known_hosts_real/known*hosts2 new file mode 100644 index 00000000..3cabce93 --- /dev/null +++ b/test/fixtures/_known_hosts_real/known*hosts2 @@ -0,0 +1 @@ +star*d2 diff --git a/test/fixtures/_known_hosts_real/star*conf b/test/fixtures/_known_hosts_real/star*conf new file mode 100644 index 00000000..a20af358 --- /dev/null +++ b/test/fixtures/_known_hosts_real/star*conf @@ -0,0 +1,2 @@ +UserKnownHostsFile fixtures/_known_hosts_real/known*hosts +UserKnownHostsFile "fixtures/_known_hosts_real/known*hosts2" diff --git a/test/lib/library.exp b/test/lib/library.exp index b663d3f4..436c70cb 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -52,6 +52,29 @@ proc assert_bash_type {command} { }; # assert_bash_type() +# Make sure the expected list is returned by executing the specified command. +# @param list $expected +# @param string $cmd Command given to generate items +# @param string $test (optional) Test titel. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" +# @param integer $size (optional) Chunk size. Default is 20. +# @result boolean True if successful, False if not +proc assert_bash_list {expected cmd {test ""} {prompt /@} {size 20}} { + if {$test == ""} {set test "$cmd should show expected output"} + send "$cmd\r\n" + expect -ex "$cmd\r\n" + + if {[match_items $expected $test]} { + expect { + -re $prompt { pass "$test" } + -re eof { unresolved "eof" } + }; # expect + } else { + fail "$test" + }; # if +}; # assert_bash_list() + + # Make sure the expected items are returned by TAB-completing the specified # command. # @param list $expected @@ -328,7 +351,7 @@ proc match_items {items test {size 20}} { for {set j 0} {$j < $size && $i + $j < [llength $items]} {incr j} { set item "[lindex $items [expr {$i + $j}]]" # Escape special regexp characters - regsub -all {([\[\]\(\)\.\\\+])} $item {\\\1} item + regsub -all {([\[\]\(\)\.\\\+\*])} $item {\\\1} item append expected $item if {[llength $items] > 1} {append expected {\s+}}; }; # for diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp index 94fc67ee..4c959982 100644 --- a/test/unit/_known_hosts_real.exp +++ b/test/unit/_known_hosts_real.exp @@ -57,7 +57,6 @@ expect { sync_after_int - set test "Config file containing space should work" set hosts [get_hosts] # Hosts `gee' and `hus' are defined in ./fixtures/_known_hosts_real/spaced conf @@ -101,6 +100,17 @@ sync_after_int assert_bash_exec "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE" +sync_after_int + + +set test "Config file containing star (*) should work" +set hosts [get_hosts] + # Hosts `star*d', `tra' and `10.0.0.0' are defined in ./fixtures/_known_hosts_real/known*hosts + # Hosts `star*d2' is defined in ./fixtures/_known_hosts_real/known*hosts2 +lappend hosts star*d star*d2 tra 10.0.0.0 +set cmd {_known_hosts_real -aF 'fixtures/_known_hosts_real/star*conf' ''; echo_array COMPREPLY} +assert_bash_list $hosts $cmd $test + sync_after_int From 2bef79059c14632a8ba7a0837ea60827773f24f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 26 Aug 2009 23:46:13 +0300 Subject: [PATCH 53/69] Add more tarball filename extensions to rpmbuild -t*/--tarbuild completion. --- CHANGES | 1 + contrib/rpm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5313884a..33d7cb87 100644 --- a/CHANGES +++ b/CHANGES @@ -103,6 +103,7 @@ bash-completion (1.x) * Complete bzcat and zcat only on compressed files. * Do not require a dot in bzcmp, bzdiff, bz*grep, zcmp, zdiff, z*grep, zless, and zmore filename completions. + * Add more tarball filename extensions to rpmbuild -t*/--tarbuild completion. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/contrib/rpm b/contrib/rpm index e6ede170..b19d1221 100644 --- a/contrib/rpm +++ b/contrib/rpm @@ -255,7 +255,7 @@ _rpm() elif [[ ${COMP_WORDS[1]} == -b* ]]; then _filedir 'spec' else - _filedir '@(tgz|tar.@(gz|bz2|lzma))' + _filedir '@(t?(ar.)@(gz|bz?(2))|tar.lzma)' fi ;; --re@(build|compile)) @@ -267,7 +267,7 @@ _rpm() fi ;; --tarbuild) - _filedir '@(tgz|tar.@(gz|bz2|lzma))' + _filedir '@(t?(ar.)@(gz|bz?(2))|tar.lzma)' ;; --@(re|add)sign) _filedir 'rpm' From 8770727a082cf5358331fb5fc6ddd8d662e1415a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 26 Aug 2009 23:58:50 +0300 Subject: [PATCH 54/69] Add xz and compress support to rpmbuild -t*/--tarbuild completion. --- CHANGES | 3 ++- contrib/rpm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 33d7cb87..05d01beb 100644 --- a/CHANGES +++ b/CHANGES @@ -103,7 +103,8 @@ bash-completion (1.x) * Complete bzcat and zcat only on compressed files. * Do not require a dot in bzcmp, bzdiff, bz*grep, zcmp, zdiff, z*grep, zless, and zmore filename completions. - * Add more tarball filename extensions to rpmbuild -t*/--tarbuild completion. + * Add xz and compress support and more tarball filename extensions to + rpmbuild -t*/--tarbuild completion. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/contrib/rpm b/contrib/rpm index b19d1221..1e480ddb 100644 --- a/contrib/rpm +++ b/contrib/rpm @@ -255,7 +255,7 @@ _rpm() elif [[ ${COMP_WORDS[1]} == -b* ]]; then _filedir 'spec' else - _filedir '@(t?(ar.)@(gz|bz?(2))|tar.lzma)' + _filedir '@(t?(ar.)@([gx]z|bz?(2))|tar.@(lzma|Z))' fi ;; --re@(build|compile)) @@ -267,7 +267,7 @@ _rpm() fi ;; --tarbuild) - _filedir '@(t?(ar.)@(gz|bz?(2))|tar.lzma)' + _filedir '@(t?(ar.)@([gx]z|bz?(2))|tar.@(lzma|Z))' ;; --@(re|add)sign) _filedir 'rpm' From 11d4d978876ceb58eaec5dcfd82fae7b9699acfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 4 Sep 2009 23:59:34 +0300 Subject: [PATCH 55/69] Improve sudo completion (Alioth: #311414). --- CHANGES | 1 + Makefile.am | 1 + bash_completion | 2 +- contrib/sudo | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 contrib/sudo diff --git a/CHANGES b/CHANGES index 05d01beb..163d047a 100644 --- a/CHANGES +++ b/CHANGES @@ -105,6 +105,7 @@ bash-completion (1.x) and zmore filename completions. * Add xz and compress support and more tarball filename extensions to rpmbuild -t*/--tarbuild completion. + * Improve sudo completion (Alioth: #311414). [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/Makefile.am b/Makefile.am index d9036329..e26f0a5d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -121,6 +121,7 @@ bashcomp_DATA = contrib/ant \ contrib/snownews \ contrib/ssh \ contrib/strace \ + contrib/sudo \ contrib/svk \ contrib/sysctl \ contrib/sysv-rc \ diff --git a/bash_completion b/bash_completion index 806dacf5..022a7d12 100644 --- a/bash_completion +++ b/bash_completion @@ -1387,7 +1387,7 @@ _root_command() { PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3 } -complete -F _root_command $filenames sudo fakeroot really gksudo gksu kdesudo +complete -F _root_command $filenames fakeroot really gksudo gksu kdesudo _longopt() { diff --git a/contrib/sudo b/contrib/sudo new file mode 100644 index 00000000..fd35932b --- /dev/null +++ b/contrib/sudo @@ -0,0 +1,35 @@ +# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*- +# ex: ts=8 sw=8 noet filetype=sh +# +# bash completion for sudo + +have sudo && +_sudo() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + # TODO: more option completions + + case $prev in + -e) + _filedir + return 0 + ;; + -u) + COMPREPLY=( $( compgen -u -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-e -u' -- $cur ) ) + return 0 + fi + + _root_command $1 $2 $3 +} && +complete -F _sudo $filenames sudo From de585f387dc6d8e88ef1bc25452f2d706ad7e0be Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Fri, 4 Sep 2009 23:08:56 +0200 Subject: [PATCH 56/69] Fix _known_hosts_real() to not glob awk script See also bugreport Alioth #311614. Added tests for the awk script processing IP numbers. To run the tests: cd test ./runUnit _known_hosts_real.exp ./runCompletion ssh.exp scp.exp sftp.exp --- CHANGES | 2 + bash_completion | 2 +- test/fixtures/_known_hosts_real/known_hosts | 2 + test/unit/_known_hosts_real.exp | 43 +++++---------------- 4 files changed, 14 insertions(+), 35 deletions(-) diff --git a/CHANGES b/CHANGES index 163d047a..8d617063 100644 --- a/CHANGES +++ b/CHANGES @@ -153,6 +153,8 @@ bash-completion (1.x) * Added setting COMP_KNOWN_HOSTS_WITH_HOSTFILE. _known_hosts_real() will add hosts from HOSTFILE, unless COMP_KNOWN_HOSTS_WITH_HOSTFILE is set to an empty value (Alioth: #311821) + * Fix _known_hosts_real() to not glob awk script - thanks to Eric Blake + (Alioth #311614) -- David Paleino Thu, 18 Jun 2009 13:12:36 +0200 diff --git a/bash_completion b/bash_completion index 022a7d12..c7640c5d 100644 --- a/bash_completion +++ b/bash_completion @@ -1176,7 +1176,7 @@ _known_hosts_real() COMPREPLY=( $( awk 'BEGIN {FS=","} /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \ gsub(" .*$", "", $i); \ - if ($i ~ /'$awkcur'/) {print $i} \ + if ($i ~ /'"$awkcur"'/) {print $i} \ }}' "${kh[@]}" 2>/dev/null ) ) fi if [ ${#khd[@]} -gt 0 ]; then diff --git a/test/fixtures/_known_hosts_real/known_hosts b/test/fixtures/_known_hosts_real/known_hosts index d54a04d0..bf39e848 100644 --- a/test/fixtures/_known_hosts_real/known_hosts +++ b/test/fixtures/_known_hosts_real/known_hosts @@ -2,3 +2,5 @@ |1|def doo ike ssh-rsa qwerty1234/Qwerty+1234== +jub,10.0.0.1 +kyl,100.0.0.2 diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp index 4c959982..76ecf7ff 100644 --- a/test/unit/_known_hosts_real.exp +++ b/test/unit/_known_hosts_real.exp @@ -14,19 +14,10 @@ setup set test "Hosts should be put in COMPREPLY" set hosts [get_hosts] # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config - # Hosts `doo' and `ike' are defined in ./fixtures/_known_hosts_real/known_hosts -lappend hosts doo gee hus ike jar -set hosts [lsort -ascii $hosts] -set hosts [join $hosts "\\s+"] - # Call _known_hosts + # doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts +lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 set cmd {_known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re "^$hosts\r\n/@$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect +assert_bash_list $hosts $cmd $test sync_after_int @@ -35,23 +26,16 @@ sync_after_int set test "Hosts should have username prefix and colon suffix" set hosts [get_hosts] # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config - # Hosts `doo' and `ike' are defined in ./fixtures/_known_hosts_real/known_hosts -lappend hosts doo gee hus ike jar + # doo, ike jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts +lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 set hosts [lsort -ascii $hosts] set expected {} foreach host $hosts { lappend expected "user@$host:" }; # foreach -set expected [join $expected "\\s+"] # Call _known_hosts set cmd {_known_hosts_real -acF fixtures/_known_hosts_real/config 'user@'; echo_array COMPREPLY} -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re "^$expected\r\n/@$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect +assert_bash_list $expected $cmd $test sync_after_int @@ -60,7 +44,6 @@ sync_after_int set test "Config file containing space should work" set hosts [get_hosts] # Hosts `gee' and `hus' are defined in ./fixtures/_known_hosts_real/spaced conf - # Hosts `doo' and `ike' are defined in ./fixtures/_known_hosts_real/known_hosts # Host `two' is defined in ./fixtures/_known_hosts_real/known_hosts2 lappend hosts gee hus doo ike two set hosts [lsort -ascii $hosts] @@ -83,19 +66,11 @@ set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE" assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE=" set hosts [get_hosts_avahi] # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config - # Hosts `doo' and `ike' are defined in ./fixtures/_known_hosts_real/known_hosts -lappend hosts doo gee hus ike jar -set hosts [lsort -ascii $hosts] -set hosts [join $hosts "\\s+"] + # doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts +lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 # Call _known_hosts set cmd {_known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re "^$hosts\r\n/@$" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -}; # expect +assert_bash_list $hosts $cmd $test sync_after_int assert_bash_exec "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE" From 47fb2d8f0e3382c7b3512c5f38c9cfc6b9f7f615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 5 Sep 2009 00:26:48 +0300 Subject: [PATCH 57/69] Revert "Improve sudo completion (Alioth: #311414)." This reverts commit 11d4d978876ceb58eaec5dcfd82fae7b9699acfd. Avoiding breaking completion for the sudo'd command isn't as straightforward as I thought. --- CHANGES | 1 - Makefile.am | 1 - bash_completion | 2 +- contrib/sudo | 35 ----------------------------------- 4 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 contrib/sudo diff --git a/CHANGES b/CHANGES index 8d617063..6d8b523c 100644 --- a/CHANGES +++ b/CHANGES @@ -105,7 +105,6 @@ bash-completion (1.x) and zmore filename completions. * Add xz and compress support and more tarball filename extensions to rpmbuild -t*/--tarbuild completion. - * Improve sudo completion (Alioth: #311414). [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/Makefile.am b/Makefile.am index e26f0a5d..d9036329 100644 --- a/Makefile.am +++ b/Makefile.am @@ -121,7 +121,6 @@ bashcomp_DATA = contrib/ant \ contrib/snownews \ contrib/ssh \ contrib/strace \ - contrib/sudo \ contrib/svk \ contrib/sysctl \ contrib/sysv-rc \ diff --git a/bash_completion b/bash_completion index c7640c5d..93ef65a4 100644 --- a/bash_completion +++ b/bash_completion @@ -1387,7 +1387,7 @@ _root_command() { PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3 } -complete -F _root_command $filenames fakeroot really gksudo gksu kdesudo +complete -F _root_command $filenames sudo fakeroot really gksudo gksu kdesudo _longopt() { diff --git a/contrib/sudo b/contrib/sudo deleted file mode 100644 index fd35932b..00000000 --- a/contrib/sudo +++ /dev/null @@ -1,35 +0,0 @@ -# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*- -# ex: ts=8 sw=8 noet filetype=sh -# -# bash completion for sudo - -have sudo && -_sudo() -{ - local cur prev - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - # TODO: more option completions - - case $prev in - -e) - _filedir - return 0 - ;; - -u) - COMPREPLY=( $( compgen -u -- $cur ) ) - return 0 - ;; - esac - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-e -u' -- $cur ) ) - return 0 - fi - - _root_command $1 $2 $3 -} && -complete -F _sudo $filenames sudo From b5505959afd6744e6d09c4a4b1a888d118aa9063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 6 Sep 2009 18:51:00 +0300 Subject: [PATCH 58/69] Don't hardcode path to lsmod. --- CHANGES | 1 + bash_completion | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 6d8b523c..fd10f142 100644 --- a/CHANGES +++ b/CHANGES @@ -105,6 +105,7 @@ bash-completion (1.x) and zmore filename completions. * Add xz and compress support and more tarball filename extensions to rpmbuild -t*/--tarbuild completion. + * Don't hardcode path to lsmod. [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/bash_completion b/bash_completion index 93ef65a4..ff639d14 100644 --- a/bash_completion +++ b/bash_completion @@ -551,7 +551,7 @@ _modules() # _installed_modules() { - COMPREPLY=( $( compgen -W "$( /sbin/lsmod | \ + COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" lsmod | \ awk '{if (NR != 1) print $1}' )" -- $1 ) ) } From e20a4cb06e1e7e4365361c42a6d19a0b6a1dbcb5 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Mon, 7 Sep 2009 00:26:27 +0200 Subject: [PATCH 59/69] Added unit tests for _get_cword These are the tests (| = cursor position): 1. a b| should return b 2. a | should return nothing 3. a b|c should return b 4. a b\ c| should return b\ c 5. a 'b c| should return 'b c 6. a "b c| should return "b c 7. a b:c| should return c 8. a b:c| with WORDBREAKS -= : should return b:c 9. a -n| should return -n Tests 5 & 6 yield "expected failures", see bugreport: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474094 . At a first glance this bugreport contains useful ideas, so anyone willing to try to make tests 5 & 6 pass, be sure to have a look there first. To run the automated tests: $ cd test && ./runUnit _get_cword.exp --- test/unit/_get_cword.exp | 69 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/test/unit/_get_cword.exp b/test/unit/_get_cword.exp index f5264d7f..25bae296 100644 --- a/test/unit/_get_cword.exp +++ b/test/unit/_get_cword.exp @@ -4,7 +4,12 @@ proc setup {} { proc teardown {} { - assert_env_unmodified + assert_env_unmodified { + /COMP_CWORD=/d + /COMP_LINE=/d + /COMP_POINT=/d + /COMP_WORDS=/d + } }; # teardown() @@ -22,4 +27,66 @@ sync_after_int # by moving the cursor left into the current word. +set test "a b| should return b"; # | = cursor position +set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _get_cword} +assert_bash_list b $cmd $test + + +set test "a | should return nothing"; # | = cursor position +set cmd {COMP_WORDS=(a); COMP_CWORD=1; COMP_LINE='a '; COMP_POINT=2; _get_cword} +send "$cmd\r" +expect -ex "$cmd\r\n/@" {pass "$test"} + + +set test "a b|c should return b"; # | = cursor position +set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _get_cword} +assert_bash_list b $cmd $test + + +set test {a b\ c| should return b\ c}; # | = cursor position +set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=6; _get_cword} +assert_bash_list {{"b\\ c"}} $cmd $test + + +# See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474094 for useful ideas +# to make this test pass. +set test {a 'b c| should return 'b c}; # | = cursor position +set cmd {COMP_WORDS=(a \' b c); COMP_CWORD=3; COMP_LINE=a\ \'b\ c; COMP_POINT=6; _get_cword} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "'b c\r\n/@" { pass "$test" } + -ex "c/@" { xfail "$test" } +}; # expect + + +# See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474094 for useful ideas +# to make this test pass. +set test {a "b c| should return "b c}; # | = cursor position +set cmd {COMP_WORDS=(a \" b c); COMP_CWORD=3; COMP_LINE=a\ \"b\ c; COMP_POINT=6; _get_cword} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "\"b c\r\n/@" { pass "$test" } + -ex "c/@" { xfail "$test" } +}; # expect + + +set test {a b:c| should return c}; # | = cursor position +set cmd {COMP_WORDS=(a b : c); COMP_CWORD=3; COMP_LINE='a b:c'; COMP_POINT=5; _get_cword} +assert_bash_list c $cmd $test + + +set test {a b:c| with WORDBREAKS -= : should return b:c}; # | = cursor position +set cmd {COMP_WORDS=(a b : c); COMP_CWORD=3; COMP_LINE='a b:c'; COMP_POINT=5; _get_cword :} +assert_bash_list b:c $cmd $test + + +# This test makes sure `_get_cword' doesn't use `echo' to return it's value, +# because -n might be interpreted by `echo' and thus will not be returned. +set test "a -n| should return -n"; # | = cursor position +set cmd {COMP_WORDS=(a -n); COMP_CWORD=1; COMP_LINE='a -n'; COMP_POINT=4; _get_cword} +assert_bash_list -n $cmd $test + + teardown From e663e1cbc003580debd3848769fe238ec3d631f0 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Mon, 7 Sep 2009 00:30:09 +0200 Subject: [PATCH 60/69] Reverted _get_cword `_get_cword' is reverted to before commit f6497298. This fixes unittest: "a b:c| with WORDBREAKS -= : should return b:c" (| = cursor position) notably by restoring passing an argument to _get_cword to omit characters from $COMP_WORDBREAKS. At the end of `get_cword', `echo "$cur"' has been changed to `printf "%s" "$cur"'. This fixes unittest: "a -n| should return -n" (| = cursor position) --- bash_completion | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/bash_completion b/bash_completion index ff639d14..07fe78c8 100644 --- a/bash_completion +++ b/bash_completion @@ -246,33 +246,29 @@ dequote() # for things like scp where we want to return host:path and not only path. _get_cword() { - if [[ "${#COMP_WORDS[COMP_CWORD]}" -eq 0 ]] || [[ "$COMP_POINT" == "${#COMP_LINE}" ]]; then - printf "%s" "${COMP_WORDS[COMP_CWORD]}" - else - local i - local cur="$COMP_LINE" - local index="$COMP_POINT" - for (( i = 0; i <= COMP_CWORD; ++i )); do - while [[ "${#cur}" -ge ${#COMP_WORDS[i]} ]] && [[ "${cur:0:${#COMP_WORDS[i]}}" != "${COMP_WORDS[i]}" ]]; do - cur="${cur:1}" - index="$(( index - 1 ))" - done - if [[ "$i" -lt "$COMP_CWORD" ]]; then - local old_size="${#cur}" - cur="${cur#${COMP_WORDS[i]}}" - local new_size="${#cur}" - index="$(( index - old_size + new_size ))" - fi + local i + local LC_CTYPE=C + local WORDBREAKS=${COMP_WORDBREAKS} + if [ -n $1 ]; then + for (( i=0; i<${#1}; ++i )); do + local char=${1:$i:1} + WORDBREAKS=${WORDBREAKS//$char/} done - - if [[ "${COMP_WORDS[COMP_CWORD]:0:${#cur}}" != "$cur" ]]; then - # We messed up! At least return the whole word so things - # keep working - printf "%s" "${COMP_WORDS[COMP_CWORD]}" - else - printf "%s" "${cur:0:$index}" - fi fi + local cur=${COMP_LINE:0:$COMP_POINT} + local tmp="${cur}" + local word_start=`expr "$tmp" : '.*['"${WORDBREAKS}"']'` + while [ "$word_start" -ge 2 ]; do + local char=${cur:$(( $word_start - 2 )):1} + if [ "$char" != "\\" ]; then + break + fi + tmp=${COMP_LINE:0:$(( $word_start - 2 ))} + word_start=`expr "$tmp" : '.*['"${WORDBREAKS}"']'` + done + + cur=${cur:$word_start} + printf "%s" "$cur" } # This function performs file and directory completion. It's better than From 603ed0acce32cbf4f91fb1eda06245c80a6e03e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 8 Sep 2009 00:08:31 +0300 Subject: [PATCH 61/69] Use --asciidoc-opts="--unsafe" instead of --unsafe for a2x for compatibility with asciidoc < 8.4.5. --- doc/makeHtml.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/makeHtml.sh b/doc/makeHtml.sh index ed29ab40..79780eb6 100755 --- a/doc/makeHtml.sh +++ b/doc/makeHtml.sh @@ -1,4 +1,4 @@ #!/bin/bash -eu [ -d html~ ] || mkdir html~ -a2x -D html~ -d book -f xhtml --unsafe main.txt +a2x -D html~ -d book -f xhtml --asciidoc-opts="--unsafe" main.txt From 81458b0b9f14404c1f6e5a6b780599471bd5f9d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 8 Sep 2009 20:20:48 +0300 Subject: [PATCH 62/69] Add yum --enable/disableplugin completions. --- CHANGES | 4 ++-- contrib/yum | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index fd10f142..3e50d99b 100644 --- a/CHANGES +++ b/CHANGES @@ -37,8 +37,8 @@ bash-completion (1.x) * Split yum and yum-arch completion into contrib/yum. * Install yum-arch completion only if yum-arch is installed. * Update list of yum commands and options. - * Add yum repolist, --enable/disablerepo, --disableexcludes, -d, -e, and - --color completions. + * Add yum repolist, --enable/disablerepo, --disableexcludes, -d, -e, --color, + and --enable/disableplugin completions. * Add chkconfig --override and resetpriorities completions. * Split mplayer and friends completions to contrib/mplayer. * Parse top level mplayer and friends option completions from -list-options. diff --git a/contrib/yum b/contrib/yum index ac757855..b61e1663 100644 --- a/contrib/yum +++ b/contrib/yum @@ -28,6 +28,12 @@ _yum_repolist() sed -ne '/^repo\(\s\+id\|list:\)/d' -e 's/[[:space:]].*//p' } +_yum_plugins() +{ + command ls /usr/lib/yum-plugins/*.py{,c,o} 2>/dev/null \ + | sed -ne 's|.*/\([^./]*\)\.py[co]\?$|\1|p' | sort -u +} + _yum() { local cur prev special split=false @@ -110,6 +116,9 @@ _yum() COMPREPLY=( $( compgen -W '$( _yum_repolist all ) \ all main' -- $cur ) ) ;; + --enableplugin|--disableplugin) + COMPREPLY=( $( compgen -W '$( _yum_plugins )' -- $cur )) + ;; --color) COMPREPLY=( $( compgen -W 'always auto never' -- $cur )) ;; From bb43fd63bf1c7a69a07df8190ef72b90307402cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 8 Sep 2009 20:28:51 +0300 Subject: [PATCH 63/69] Split yum into _yum and yum-arch. The plan is to move yum completion to yum upstream soon: http://lists.baseurl.org/pipermail/yum-devel/2009-August/005777.html --- CHANGES | 6 ++++-- Makefile.am | 4 ++-- contrib/{yum => _yum} | 0 contrib/yum-arch | 25 +++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 4 deletions(-) rename contrib/{yum => _yum} (100%) create mode 100644 contrib/yum-arch diff --git a/CHANGES b/CHANGES index 3e50d99b..b032d0d1 100644 --- a/CHANGES +++ b/CHANGES @@ -34,8 +34,10 @@ bash-completion (1.x) * Added avahi-discovered hosts to _known_hosts_real() (Debian: #518561) [ Ville Skyttä ] - * Split yum and yum-arch completion into contrib/yum. - * Install yum-arch completion only if yum-arch is installed. + * Split yum completion to contrib/_yum (no longer installed by default, the + intent is to move it to yum upstream soon). + * Split yum-arch completion into contrib/yum-arch, load completion only if + yum-arch is installed. * Update list of yum commands and options. * Add yum repolist, --enable/disablerepo, --disableexcludes, -d, -e, --color, and --enable/disableplugin completions. diff --git a/Makefile.am b/Makefile.am index d9036329..bfedeff2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -142,6 +142,6 @@ bashcomp_DATA = contrib/ant \ contrib/xrandr \ contrib/xz \ contrib/yp-tools \ - contrib/yum + contrib/yum-arch -EXTRA_DIST = $(sysconf_DATA) $(bashcomp_DATA) contrib/_subversion +EXTRA_DIST = $(sysconf_DATA) $(bashcomp_DATA) contrib/_subversion contrib/_yum diff --git a/contrib/yum b/contrib/_yum similarity index 100% rename from contrib/yum rename to contrib/_yum diff --git a/contrib/yum-arch b/contrib/yum-arch new file mode 100644 index 00000000..d9e6b4b6 --- /dev/null +++ b/contrib/yum-arch @@ -0,0 +1,25 @@ +# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*- +# ex: ts=8 sw=8 noet filetype=sh + +# yum-arch(8) completion +# +have yum-arch && +_yum_arch() +{ + local cur + COMPREPLY=() + cur=`_get_cword` + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l \ + -q' -- $cur ) ) + ;; + *) + _filedir -d + ;; + esac + + return 0 +} && +complete -F _yum_arch $filenames yum-arch From c31daf26aeab8921e47613eda586517c511f9a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 9 Sep 2009 18:54:18 +0300 Subject: [PATCH 64/69] Fix sbcl file/dirname completion (Debian: #545743). --- CHANGES | 1 + contrib/sbcl | 2 +- test/lib/completions/sbcl-mt.exp | 2 +- test/lib/completions/sbcl.exp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index b032d0d1..0f46f352 100644 --- a/CHANGES +++ b/CHANGES @@ -108,6 +108,7 @@ bash-completion (1.x) * Add xz and compress support and more tarball filename extensions to rpmbuild -t*/--tarbuild completion. * Don't hardcode path to lsmod. + * Fix sbcl file/dirname completion (Debian: #545743). [ Todd Zullinger ] * Make yum complete on filenames after install, deplist, update and upgrade diff --git a/contrib/sbcl b/contrib/sbcl index 9f722f7b..3dec851f 100644 --- a/contrib/sbcl +++ b/contrib/sbcl @@ -23,4 +23,4 @@ _sbcl() return 0 } && -complete -F _sbcl $default sbcl sbcl-mt +complete -F _sbcl $filenames sbcl sbcl-mt diff --git a/test/lib/completions/sbcl-mt.exp b/test/lib/completions/sbcl-mt.exp index 905a62ca..1188f197 100644 --- a/test/lib/completions/sbcl-mt.exp +++ b/test/lib/completions/sbcl-mt.exp @@ -11,7 +11,7 @@ proc teardown {} { setup -assert_complete_any "sbcl-mt " +assert_complete {bar "bar bar.d/" foo foo.d/} "sbcl-mt fixture1/" sync_after_int diff --git a/test/lib/completions/sbcl.exp b/test/lib/completions/sbcl.exp index 27633320..d5f2c8c2 100644 --- a/test/lib/completions/sbcl.exp +++ b/test/lib/completions/sbcl.exp @@ -11,7 +11,7 @@ proc teardown {} { setup -assert_complete_any "sbcl " +assert_complete {bar "bar bar.d/" foo foo.d/} "sbcl fixture1/" sync_after_int From 2c82de1a575fc570382391aedee1d1c2665418b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 9 Sep 2009 19:03:07 +0300 Subject: [PATCH 65/69] Add Fedora/RHEL/CentOS dependency install info. --- doc/testing.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/testing.txt b/doc/testing.txt index 8ebb29d3..14cf6ff4 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -10,10 +10,10 @@ The bash-completion test suite is written on top of the http://www.gnu.org/softw -Installing DejaGnu ------------------- +Installing dependencies +----------------------- -Installing DejaGnu should be easy using your local package manager. +Installing dependencies should be easy using your local package manager. Debian/Ubuntu @@ -25,6 +25,14 @@ sudo apt-get install dejagnu ------------- This should also install the necessary `expect` and `tcl` packages. +Fedora/RHEL/CentOS +~~~~~~~~~~~~~~~~~~ + +On Fedora and RHEL/CentOS (with EPEL) you can use `yum`: +------------- +sudo yum install dejagnu tcllib +------------- +This should also install the necessary `expect` and `tcl` packages. From 0e1e189f0b3741638e95ae19a63016e8049eb6a2 Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sat, 12 Sep 2009 21:54:17 +0200 Subject: [PATCH 66/69] Fix leaking $muttcmd from mutt completion --- contrib/mutt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/mutt b/contrib/mutt index ff7655f3..2145f5dc 100644 --- a/contrib/mutt +++ b/contrib/mutt @@ -39,7 +39,7 @@ _muttconffiles() _muttaliases() { - local cur muttrc + local cur muttrc muttcmd=${COMP_WORDS[0]} local -a conffiles aliases cur=`_get_cword =` @@ -57,7 +57,7 @@ _muttaliases() _muttquery() { - local cur querycmd + local cur querycmd muttcmd=${COMP_WORDS[0]} local -a queryresults cur=`_get_cword` @@ -77,7 +77,7 @@ _muttquery() _muttfiledir() { - local cur folder spoolfile + local cur folder spoolfile muttcmd=${COMP_WORDS[0]} cur=`_get_cword` # This is currently not working so well. Perhaps this function should @@ -108,8 +108,6 @@ _mutt() COMPREPLY=() - [ ${COMP_WORDS[0]} == muttng ] && muttcmd="muttng" || muttcmd="mutt" - case "$cur" in -*) COMPREPLY=( $( compgen -W '-A -a -b -c -e -f -F -H -i -m -n \ From 4467ce17250b4ef2fe189dd748eb1f19348be43f Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sat, 12 Sep 2009 22:31:10 +0200 Subject: [PATCH 67/69] Fix completion test for dpgk -L --- test/lib/completions/dpkg.exp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/lib/completions/dpkg.exp b/test/lib/completions/dpkg.exp index ff4c5274..9e01882b 100644 --- a/test/lib/completions/dpkg.exp +++ b/test/lib/completions/dpkg.exp @@ -18,10 +18,7 @@ sync_after_int # Build list of installed packages - # NOTE: If an argument is passed to `--get-selections', `dpkg' also returns - # packages with status "purged". Be sure to add `| grep install$' to - # pipeline before 'cut' in that case. -- FVu, Sun Feb 22 10:08:34 CET 2009 -if {[assert_exec {dpkg --get-selections | cut -f1} packages]} { +if {[assert_exec {dpkg --get-selections | grep \[\[:space:\]\]install$ | cut -f1} packages]} { assert_complete $packages "dpkg -L " }; # if From 03526772fa767a1a370faed1047088744e32091a Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sun, 13 Sep 2009 18:05:58 +0200 Subject: [PATCH 68/69] Fixes testsuite: - Fix get_hosts_avahi() if avahi-browse not available - Removed test "Tab should complete hostnames" from finger since it's returning (for the moment) undetectable ip-addresses from known_hosts files. Furthermore the next test "Tab should complete partial hostname" is testing the same. --- test/lib/completions/finger.exp | 13 ------------- test/lib/library.exp | 11 ++++++++--- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/test/lib/completions/finger.exp b/test/lib/completions/finger.exp index 136f1c6e..4ad21cf0 100644 --- a/test/lib/completions/finger.exp +++ b/test/lib/completions/finger.exp @@ -30,19 +30,6 @@ assert_complete_partial [exec bash -c "compgen -A user"] "finger" sync_after_int -set test "Tab should complete hostnames" -# Build string list of hostnames -set hosts {} -foreach h [get_hosts] { - # Prefix hosts with username 'test@' - lappend hosts "test@$h" -}; # foreach -assert_complete_partial $hosts finger test@ $test - - -sync_after_int - - set test "Tab should complete partial hostname" # Build string list of hostnames, starting with the character of the first # host. diff --git a/test/lib/library.exp b/test/lib/library.exp index 436c70cb..ba225fc3 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -311,10 +311,15 @@ proc get_hosts {} { # Get hostnames according to avahi # @return list Hostnames proc get_hosts_avahi {} { - set hosts [exec bash -c { + # Retrieving hosts is successful? + if { [catch {exec bash -c { type avahi-browse >&/dev/null && [ -n "$(pidof avahi-daemon)" ] - avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u - }] + && avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u + }} hosts] } { + # No, retrieving hosts yields error; + # Reset hosts + set hosts {} + }; # if return $hosts }; # get_hosts_avahi() From 8eaf5a1c2a922240445f57ba7e525217aa661a3e Mon Sep 17 00:00:00 2001 From: Freddy Vulto Date: Sun, 13 Sep 2009 21:29:35 +0200 Subject: [PATCH 69/69] Updated CHANGES --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index 0f46f352..f33cc3ef 100644 --- a/CHANGES +++ b/CHANGES @@ -158,6 +158,7 @@ bash-completion (1.x) empty value (Alioth: #311821) * Fix _known_hosts_real() to not glob awk script - thanks to Eric Blake (Alioth #311614) + * Fix leaking $muttcmd from mutt completion -- David Paleino Thu, 18 Jun 2009 13:12:36 +0200