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

Ville Skyttä ville.skytta at iki.fi
Sun Jan 24 21:37:47 UTC 2010


The following commit has been merged in the master branch:
commit 89e52de0c587b3557fac33b4b0581fd886a51439
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Jan 24 23:02:12 2010 +0200

    (testsuite) Fix cvsps non-option completion test, add test for options.
    
    "cvsps " completion failed when there was nothing in ~/.cvspass,
    create a fixture for generic cvs use containing one, and use it.

diff --git a/test/fixtures/cvs/.cvspass b/test/fixtures/cvs/.cvspass
new file mode 100644
index 0000000..e7e0dce
--- /dev/null
+++ b/test/fixtures/cvs/.cvspass
@@ -0,0 +1,2 @@
+/1 :pserver:anonymous at cvs.savannah.nongnu.org:2401/sources/cvs A
+/1 :pserver:anonymous at cvs.fedoraproject.org:2401/cvs/pkgs A
diff --git a/test/lib/completions/cvsps.exp b/test/lib/completions/cvsps.exp
index add74c0..1fd4a0a 100644
--- a/test/lib/completions/cvsps.exp
+++ b/test/lib/completions/cvsps.exp
@@ -1,17 +1,33 @@
 proc setup {} {
     save_env
+    assert_bash_exec {OLDHOME=$HOME ; HOME=$TESTDIR/fixtures/cvs}
 }; # setup()
 
 
 proc teardown {} {
-    assert_env_unmodified
+    assert_bash_exec {HOME=$OLDHOME}
+    assert_env_unmodified {
+        /OLDHOME=/d
+    }
 }; # teardown()
 
 
 setup
 
 
-assert_complete_any "cvsps "
+assert_complete_any "cvsps -"
+
+
+sync_after_int
+
+
+set test "No arguments should complete CVS roots"
+set cmd "cvsps "
+send "$cmd\t"
+expect {
+    -re "^$cmd\r\n.*:pserver:.*\r\n/@$cmd:pserver:.*$" { pass "$test" }
+    default { fail "$test" }
+}; # expect
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list