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

Ville Skyttä ville.skytta at iki.fi
Mon Apr 26 18:36:26 UTC 2010


The following commit has been merged in the master branch:
commit 9c9df7f2b763d6411f7bd98dc924ef2102b73ccd
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Apr 26 21:34:37 2010 +0300

    Add pkgtools fixture, test port{upgrade,install} and pkg_deinstall against it.

diff --git a/test/fixtures/_filedir/ext/foo/.gitignore b/test/fixtures/pkgtools/db/a-1.0,1/.gitignore
similarity index 100%
copy from test/fixtures/_filedir/ext/foo/.gitignore
copy to test/fixtures/pkgtools/db/a-1.0,1/.gitignore
diff --git a/test/fixtures/_filedir/ext/foo/.gitignore b/test/fixtures/pkgtools/db/b-c-d-2.0_2/.gitignore
similarity index 100%
copy from test/fixtures/_filedir/ext/foo/.gitignore
copy to test/fixtures/pkgtools/db/b-c-d-2.0_2/.gitignore
diff --git a/test/fixtures/pkgtools/ports/.gitignore b/test/fixtures/pkgtools/ports/.gitignore
new file mode 100644
index 0000000..71d2c0c
--- /dev/null
+++ b/test/fixtures/pkgtools/ports/.gitignore
@@ -0,0 +1,2 @@
+INDEX
+INDEX-5
diff --git a/test/fixtures/pkgtools/ports/INDEX.dist b/test/fixtures/pkgtools/ports/INDEX.dist
new file mode 100644
index 0000000..76957d4
--- /dev/null
+++ b/test/fixtures/pkgtools/ports/INDEX.dist
@@ -0,0 +1,3 @@
+bash-3.1.17|PORTSDIR/shells/bash|/usr/local|The GNU Project's Bourne Again SHell|PORTSDIR/shells/bash/pkg-descr|obrien at FreeBSD.org|shells|expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html|||
+bash-completion-20060301_2|PORTSDIR/shells/bash-completion|/usr/local|Programmable completion library for Bash 2.04 and up|PORTSDIR/shells/bash-completion/pkg-descr|kirk at strauser.com|shells||bash-3.1.17 expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|http://www.caliban.org/bash/index.shtml|||
+bash-2.05b.007_6|PORTSDIR/shells/bash2|/usr/local|The GNU Bourne Again Shell|PORTSDIR/shells/bash2/pkg-descr|ports at FreeBSD.org|shells|||http://www.gnu.org/software/bash/|||
diff --git a/test/lib/completions/pkg_deinstall.exp b/test/lib/completions/pkg_deinstall.exp
index fffc502..8f3d8c3 100644
--- a/test/lib/completions/pkg_deinstall.exp
+++ b/test/lib/completions/pkg_deinstall.exp
@@ -1,4 +1,5 @@
 proc setup {} {
+    assert_bash_exec {PKG_DBDIR=fixtures/pkgtools/db}
     save_env
 }; # setup()
 
@@ -11,7 +12,8 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "pkg_deinstall "
+set pkgs [exec bash -c "cd fixtures/pkgtools/db ; compgen -d"]
+assert_complete $pkgs "pkg_deinstall "
 
 
 sync_after_int
diff --git a/test/lib/completions/portinstall.exp b/test/lib/completions/portinstall.exp
index 677ac65..d70f5db 100644
--- a/test/lib/completions/portinstall.exp
+++ b/test/lib/completions/portinstall.exp
@@ -1,9 +1,11 @@
 proc setup {} {
+    assert_bash_exec {PORTSDIR=fixtures/pkgtools/ports ; sed -e s,PORTSDIR,$PORTSDIR,g $PORTSDIR/INDEX.dist > $PORTSDIR/INDEX ; cp $PORTSDIR/INDEX $PORTSDIR/INDEX-5}
     save_env
 }; # setup()
 
 
 proc teardown {} {
+    assert_bash_exec {rm fixtures/pkgtools/ports/INDEX fixtures/pkgtools/ports/INDEX-5}
     assert_env_unmodified
 }; # teardown()
 
@@ -11,7 +13,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "portinstall "
+assert_complete "bash-2.05b.007_6 bash-3.1.17 bash-completion-20060301_2 shells/bash shells/bash-completion shells/bash2" "portinstall "
 
 
 sync_after_int
diff --git a/test/lib/completions/portupgrade.exp b/test/lib/completions/portupgrade.exp
index e80281b..cb58392 100644
--- a/test/lib/completions/portupgrade.exp
+++ b/test/lib/completions/portupgrade.exp
@@ -1,4 +1,5 @@
 proc setup {} {
+    assert_bash_exec {PKG_DBDIR=fixtures/pkgtools/db}
     save_env
 }; # setup()
 
@@ -11,7 +12,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "portupgrade "
+assert_complete "a b-c-d" "portupgrade "
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list