[Bash-completion-commits] [SCM] bash-completion branch, master, updated. c769eeaf8c1331536427cc98104ef460461b16e6
Freddy Vulto
fvulto at gmail.com
Fri Jun 19 12:58:16 UTC 2009
The following commit has been merged in the master branch:
commit c769eeaf8c1331536427cc98104ef460461b16e6
Author: Freddy Vulto <fvulto at gmail.com>
Date: Fri Jun 19 14:56:36 2009 +0200
(testsuite) Centralized tcl function `get_hosts'
diff --git a/test/lib/completions/ssh.exp b/test/lib/completions/ssh.exp
index 82436d5..81b88e4 100644
--- a/test/lib/completions/ssh.exp
+++ b/test/lib/completions/ssh.exp
@@ -63,7 +63,7 @@ sync_after_int
set test "Tab should complete partial hostname"
-assert_complete_partial [exec bash -c "compgen -A hostname"] "ssh"
+assert_complete_partial [get_hosts] "ssh"
sync_after_int
diff --git a/test/lib/library.exp b/test/lib/library.exp
index 1d844ae..7147980 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -213,6 +213,18 @@ proc assert_exec {cmd {stdout ''} {test ''}} {
}; # assert_exec()
+# Get known hostnames
+# @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
+ }]
+ return $hosts
+}; # get_hosts()
+
+
# Expect items.
# Break items into chunks because `expect' seems to have a limited buffer size
# @param list $items
diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp
index 7959340..3378c82 100644
--- a/test/unit/_known_hosts_real.exp
+++ b/test/unit/_known_hosts_real.exp
@@ -8,16 +8,6 @@ proc teardown {} {
}; # teardown()
-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
- }]
- return $hosts
-}; # get_hosts()
-
-
setup
--
bash-completion
More information about the Bash-completion-commits
mailing list