From 89e52de0c587b3557fac33b4b0581fd886a51439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 24 Jan 2010 23:02:12 +0200 Subject: (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. --- test/fixtures/cvs/.cvspass | 2 ++ test/lib/completions/cvsps.exp | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/cvs/.cvspass (limited to 'test') diff --git a/test/fixtures/cvs/.cvspass b/test/fixtures/cvs/.cvspass new file mode 100644 index 00000000..e7e0dce7 --- /dev/null +++ b/test/fixtures/cvs/.cvspass @@ -0,0 +1,2 @@ +/1 :pserver:anonymous@cvs.savannah.nongnu.org:2401/sources/cvs A +/1 :pserver:anonymous@cvs.fedoraproject.org:2401/cvs/pkgs A diff --git a/test/lib/completions/cvsps.exp b/test/lib/completions/cvsps.exp index add74c0b..1fd4a0a9 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 -- cgit v1.2.1