Freddy Vulto e847d57e50 Improved test suite from bash-completion-lib
Run the tests with:
$ cd test
$ ./runCompletionUnit
$ ./runCompletionCompletion

The last test of unit/_known_hosts gives UNRESOLVED and needs fixing.
2009-06-09 22:49:53 +02:00

46 lines
818 B
Plaintext

proc setup {} {
save_env
}; # setup()
proc teardown {} {
assert_env_unmodified
}; # teardown()
setup
set test "Tab should complete both commands and hostnames"
# Try completion
set cmd "ssh -F fixtures/ssh/config ls"
send "$cmd\t"
set expected "^$cmd\r\n.*ls.*ls_known_host.*\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
teardown