[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 11302d40388b700132dd722d2cbbc531477c74c5

Freddy Vulto fvulto at gmail.com
Sat Jul 18 14:57:49 UTC 2009


The following commit has been merged in the master branch:
commit 11302d40388b700132dd722d2cbbc531477c74c5
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Sat Jul 18 16:55:23 2009 +0200

    Reviewed tests h* & i*
    Localized `i' variable in `info' completion.

diff --git a/contrib/info b/contrib/info
index 745d3e1..c6c142e 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 6f38543..0000000
--- 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 0c6aae1..0000000
--- 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 5c2cfbd..0000000
--- 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 2aca482..0000000
--- 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 0bbbacf..0000000
--- 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 b2776e2..0000000
--- 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 fc1957a..0000000
--- 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 db4cde2..0000000
--- 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 32429d9..0000000
--- 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 cf3c195..0000000
--- 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 da1aab8..0000000
--- 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 5093383..0000000
--- 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 e598d86..0000000
--- 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 b324b1a..0000000
--- 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 0000000..fe064ac
--- /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 0000000..8e21c8a
--- /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 0000000..e5b963e
--- /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 0000000..ed4197e
--- /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 0000000..ca83edb
--- /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 0000000..5018e6e
--- /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 0000000..d618f90
--- /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 0000000..82a9328
--- /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 0000000..af6bc61
--- /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 0000000..e86b6ce
--- /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 0000000..6540317
--- /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 0000000..e621b78
--- /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 0000000..7cd318c
--- /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 0000000..96319f3
--- /dev/null
+++ b/test/fixtures/isql/odbc.ini
@@ -0,0 +1,3 @@
+[foo]
+
+[bar]
diff --git a/test/lib/completions/bash.exp b/test/lib/completions/head.exp
similarity index 82%
copy from test/lib/completions/bash.exp
copy to test/lib/completions/head.exp
index 4caf58f..9782f5e 100644
--- a/test/lib/completions/bash.exp
+++ b/test/lib/completions/head.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "bash --"
+assert_complete_any "head --"
 
 
 sync_after_int
diff --git a/test/lib/completions/bc.exp b/test/lib/completions/iconv.exp
similarity index 83%
copy from test/lib/completions/bc.exp
copy to test/lib/completions/iconv.exp
index c437d03..0089533 100644
--- a/test/lib/completions/bc.exp
+++ b/test/lib/completions/iconv.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "bc --"
+assert_complete_any "iconv "
 
 
 sync_after_int
diff --git a/test/lib/completions/cat.exp b/test/lib/completions/id.exp
similarity index 84%
copy from test/lib/completions/cat.exp
copy to test/lib/completions/id.exp
index 46e8775..155af52 100644
--- a/test/lib/completions/cat.exp
+++ b/test/lib/completions/id.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "cat "
+assert_complete_any "id -"
 
 
 sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/identify.exp
similarity index 81%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/identify.exp
index 26065d2..8f38ae4 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/identify.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_complete_any "identify -"
 
 
 sync_after_int
diff --git a/test/lib/completions/bash.exp b/test/lib/completions/ifdown.exp
similarity index 82%
copy from test/lib/completions/bash.exp
copy to test/lib/completions/ifdown.exp
index 4caf58f..68225bb 100644
--- a/test/lib/completions/bash.exp
+++ b/test/lib/completions/ifdown.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "bash --"
+assert_complete_any "ifdown "
 
 
 sync_after_int
diff --git a/test/lib/completions/bc.exp b/test/lib/completions/ifup.exp
similarity index 83%
copy from test/lib/completions/bc.exp
copy to test/lib/completions/ifup.exp
index c437d03..9d71717 100644
--- a/test/lib/completions/bc.exp
+++ b/test/lib/completions/ifup.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "bc --"
+assert_complete_any "ifup "
 
 
 sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/indent.exp
similarity index 81%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/indent.exp
index 26065d2..e8fc32b 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/indent.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_complete_any "indent --"
 
 
 sync_after_int
diff --git a/test/lib/completions/bc.exp b/test/lib/completions/info.exp
similarity index 83%
copy from test/lib/completions/bc.exp
copy to test/lib/completions/info.exp
index c437d03..ed769f1 100644
--- a/test/lib/completions/bc.exp
+++ b/test/lib/completions/info.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "bc --"
+assert_complete_any "info "
 
 
 sync_after_int
diff --git a/test/lib/completions/bash.exp b/test/lib/completions/inject.exp
similarity index 82%
copy from test/lib/completions/bash.exp
copy to test/lib/completions/inject.exp
index 4caf58f..7c09314 100644
--- a/test/lib/completions/bash.exp
+++ b/test/lib/completions/inject.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "bash --"
+assert_complete_any "inject "
 
 
 sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/insmod.exp
similarity index 81%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/insmod.exp
index 26065d2..8e83f0b 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/insmod.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_complete_any "insmod in"
 
 
 sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/invoke-rc.d.exp
similarity index 80%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/invoke-rc.d.exp
index 26065d2..4dc9f1d 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/invoke-rc.d.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_complete_any "invoke-rc.d "
 
 
 sync_after_int
diff --git a/test/lib/completions/cat.exp b/test/lib/completions/irb.exp
similarity index 84%
copy from test/lib/completions/cat.exp
copy to test/lib/completions/irb.exp
index 46e8775..81bea6d 100644
--- a/test/lib/completions/cat.exp
+++ b/test/lib/completions/irb.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "cat "
+assert_complete_any "irb "
 
 
 sync_after_int
diff --git a/test/lib/completions/isql.exp b/test/lib/completions/isql.exp
new file mode 100644
index 0000000..87e16bc
--- /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/animate.exp b/test/lib/completions/iwconfig.exp
similarity index 80%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/iwconfig.exp
index 26065d2..f09719d 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/iwconfig.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_complete_any "iwconfig --"
 
 
 sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/iwlist.exp
similarity index 81%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/iwlist.exp
index 26065d2..80a2c36 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/iwlist.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_complete_any "iwlist --"
 
 
 sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/iwpriv.exp
similarity index 81%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/iwpriv.exp
index 26065d2..f3102cc 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/iwpriv.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_complete_any "iwpriv --"
 
 
 sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/iwspy.exp
similarity index 81%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/iwspy.exp
index 26065d2..5fa0bee 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/iwspy.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_env_unmodified "iwspy --"
 
 
 sync_after_int
diff --git a/test/lib/completions_to_review/head.exp b/test/lib/completions_to_review/head.exp
deleted file mode 100644
index cb504c0..0000000
--- 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 9f09878..0000000
--- 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 654772a..0000000
--- 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 0ac7668..0000000
--- 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 918c843..0000000
--- 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 7f1a42b..0000000
--- 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 69918ae..0000000
--- 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 e8a8e16..0000000
--- 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 0903da7..0000000
--- 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 3ddd21d..0000000
--- 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 ea41251..0000000
--- 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 dc1e262..0000000
--- 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 7adaacd..0000000
--- 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 02eb540..0000000
--- 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 38fffd1..0000000
--- 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 3989847..0000000
--- 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 971b28f..0000000
--- 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 62f11d3..0000000
--- 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 f5043ff..3d92732 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()
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list