[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 7b67991c1818a8e2fe89990cf71fa33df8e1b731

Freddy Vulto fvulto at gmail.com
Fri Jul 2 05:08:14 UTC 2010


The following commit has been merged in the master branch:
commit 7b67991c1818a8e2fe89990cf71fa33df8e1b731
Author: Freddy Vulto <fvulto at gmail.com>
Date:   Fri Jul 2 07:06:32 2010 +0200

    (testsuite) Fix ls test
    Append slash (/) or space (" ") to completion depending on whether
    `~user' home directory exists or not.

diff --git a/test/lib/completions/ls.exp b/test/lib/completions/ls.exp
index fa47f85..a7537dc 100644
--- a/test/lib/completions/ls.exp
+++ b/test/lib/completions/ls.exp
@@ -22,8 +22,9 @@ sync_after_int
 set test "~part should complete to ~full"
 assert_bash_exec {compgen -u} {} /@ users
 find_unique_completion_pair $users part full
-set cmd [format {ls ~%s} $part]
-assert_complete "~$full/" $cmd $test
+# If home directory exists, append slash "/", else space " "
+set trail [expr {[llength [glob -nocomplain ~$full]] ? "/" : " "}]
+assert_complete "~$full$trail" "ls ~$part" $test
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list