[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 8eaf5a1c2a922240445f57ba7e525217aa661a3e

Freddy Vulto fvulto at gmail.com
Sun Sep 13 19:30:20 UTC 2009


The following commit has been merged in the master branch:
commit 03526772fa767a1a370faed1047088744e32091a
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Sun Sep 13 18:05:58 2009 +0200

    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.

diff --git a/test/lib/completions/finger.exp b/test/lib/completions/finger.exp
index 136f1c6..4ad21cf 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 436c70c..ba225fc 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()
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list