Reviewed tests h* & i*
Localized `i' variable in `info' completion.
This commit is contained in:
parent
c6af1bf435
commit
11302d4038
@ -6,7 +6,7 @@
|
||||
have info &&
|
||||
_info()
|
||||
{
|
||||
local cur infopath
|
||||
local cur i infopath
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
|
@ -1 +0,0 @@
|
||||
source "lib/completions/head.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/hg.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/iconv.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/id.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/identify.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/ifdown.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/ifup.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/indent.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/info.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/inject.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/insmod.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/invoke-rc.d.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/irb.exp"
|
@ -1 +0,0 @@
|
||||
source "lib/completions/isql.exp"
|
3
test/completion/head.exp
Normal file
3
test/completion/head.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {head}]} {
|
||||
source "lib/completions/head.exp"
|
||||
}; # if
|
3
test/completion/iconv.exp
Normal file
3
test/completion/iconv.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {iconv}]} {
|
||||
source "lib/completions/iconv.exp"
|
||||
}; # if
|
3
test/completion/id.exp
Normal file
3
test/completion/id.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {id}]} {
|
||||
source "lib/completions/id.exp"
|
||||
}; # if
|
3
test/completion/identify.exp
Normal file
3
test/completion/identify.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {convert}]} {
|
||||
source "lib/completions/identify.exp"
|
||||
}; # if
|
3
test/completion/ifdown.exp
Normal file
3
test/completion/ifdown.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {ifdown}]} {
|
||||
source "lib/completions/ifdown.exp"
|
||||
}; # if
|
3
test/completion/ifup.exp
Normal file
3
test/completion/ifup.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {ifup}]} {
|
||||
source "lib/completions/ifup.exp"
|
||||
}; # if
|
3
test/completion/indent.exp
Normal file
3
test/completion/indent.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {indent}]} {
|
||||
source "lib/completions/indent.exp"
|
||||
}; # if
|
3
test/completion/info.exp
Normal file
3
test/completion/info.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {info}]} {
|
||||
source "lib/completions/info.exp"
|
||||
}; # if
|
3
test/completion/inject.exp
Normal file
3
test/completion/inject.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {inject}]} {
|
||||
source "lib/completions/inject.exp"
|
||||
}; # if
|
3
test/completion/insmod.exp
Normal file
3
test/completion/insmod.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {insmod}]} {
|
||||
source "lib/completions/insmod.exp"
|
||||
}; # if
|
3
test/completion/invoke-rc.d.exp
Normal file
3
test/completion/invoke-rc.d.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {invoke-rc.d}]} {
|
||||
source "lib/completions/invoke-rc.d.exp"
|
||||
}; # if
|
3
test/completion/irb.exp
Normal file
3
test/completion/irb.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {irb}]} {
|
||||
source "lib/completions/irb.exp"
|
||||
}; # if
|
3
test/completion/isql.exp
Normal file
3
test/completion/isql.exp
Normal file
@ -0,0 +1,3 @@
|
||||
if {[assert_bash_type {isql}]} {
|
||||
source "lib/completions/isql.exp"
|
||||
}; # if
|
3
test/fixtures/isql/odbc.ini
vendored
Normal file
3
test/fixtures/isql/odbc.ini
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[foo]
|
||||
|
||||
[bar]
|
20
test/lib/completions/head.exp
Normal file
20
test/lib/completions/head.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "head --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/iconv.exp
Normal file
20
test/lib/completions/iconv.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "iconv "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/id.exp
Normal file
20
test/lib/completions/id.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "id -"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/identify.exp
Normal file
20
test/lib/completions/identify.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "identify -"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/ifdown.exp
Normal file
20
test/lib/completions/ifdown.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "ifdown "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/ifup.exp
Normal file
20
test/lib/completions/ifup.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "ifup "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/indent.exp
Normal file
20
test/lib/completions/indent.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "indent --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/info.exp
Normal file
20
test/lib/completions/info.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "info "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/inject.exp
Normal file
20
test/lib/completions/inject.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "inject "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/insmod.exp
Normal file
20
test/lib/completions/insmod.exp
Normal file
@ -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
|
20
test/lib/completions/invoke-rc.d.exp
Normal file
20
test/lib/completions/invoke-rc.d.exp
Normal file
@ -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
|
20
test/lib/completions/irb.exp
Normal file
20
test/lib/completions/irb.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "irb "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
23
test/lib/completions/isql.exp
Normal file
23
test/lib/completions/isql.exp
Normal file
@ -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
|
20
test/lib/completions/iwconfig.exp
Normal file
20
test/lib/completions/iwconfig.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "iwconfig --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/iwlist.exp
Normal file
20
test/lib/completions/iwlist.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "iwlist --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/iwpriv.exp
Normal file
20
test/lib/completions/iwpriv.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "iwpriv --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
20
test/lib/completions/iwspy.exp
Normal file
20
test/lib/completions/iwspy.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}; # setup()
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}; # teardown()
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_env_unmodified "iwspy --"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user