The following commit has been merged in the master branch:
commit 61f83856fb1365e8c9df525dbcc5b74708ddbfe4
Author: Leonard Crestez <[email protected]>
Date:   Mon Feb 1 21:28:17 2010 +0200

    (testsuite) Fix chown test "crash" if root user/group is N/A (Alioth: 
312306).

diff --git a/test/lib/completions/chown.exp b/test/lib/completions/chown.exp
index cc56149..480f674 100644
--- a/test/lib/completions/chown.exp
+++ b/test/lib/completions/chown.exp
@@ -24,10 +24,14 @@ set partgroup "roo"
 
 # Skip tests if root:root not available or if roo:roo matches multiple
 # users/groups
-if {[exec bash -c "compgen -A user $partuser" | wc -l] > 1 ||
-    [exec bash -c "compgen -A user $fulluser" | wc -l] != 1 ||
-    [exec bash -c "compgen -A group $partgroup" | wc -l] > 1 ||
-    [exec bash -c "compgen -A group $fullgroup" | wc -l] != 1} {
+#
+# compgen -A is used because it's a bash builtin and available everywhere.
+# The || true part prevents exec from throwing an exception if nothing is
+# found.
+if {[exec bash -c "compgen -A user $partuser || true" | wc -l] > 1 ||
+    [exec bash -c "compgen -A user $fulluser || true" | wc -l] != 1 ||
+    [exec bash -c "compgen -A group $partgroup || true" | wc -l] > 1 ||
+    [exec bash -c "compgen -A group $fullgroup || true" | wc -l] != 1} {
     untested "Not running complex chown tests."
 } else {
     assert_complete $fulluser "chown $partuser"

-- 
bash-completion

_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-commits

Reply via email to