From 9ae5f36e46584f1f24c2e8fdf30d2754f92caf3e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 10 Apr 2009 22:41:28 +0200 Subject: Added tests for pkg add, extended tests for pkg list --- test/main | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/main b/test/main index feb2471..0938970 100755 --- a/test/main +++ b/test/main @@ -40,8 +40,8 @@ echo "# checking for success" [[ -d $test_pdir/core ]] echo "# pkg list local" -stringcmp "core" $(pkg list) -stringcmp "core" $(pkg list local) +stringcmp "core" "$(pkg list)" +stringcmp "core" "$(pkg list local)" echo "# pkg list not-installed" stringcmp "ra\nrb\nrc" "$(pkg list not-installed)" @@ -49,6 +49,28 @@ stringcmp "ra\nrb\nrc" "$(pkg list not-installed)" echo "# pkg list all" stringcmp "core\nra\nrb\nrc" "$(pkg list all)" +echo "# pkg add (no such repo)" +! pkg add weltfrieden + +echo "# pkg add (already installed)" +! pkg add core + +echo "# pkg add (ok)" +pkg add ra +[[ -e $test_pdir/ra/foo ]] +[[ -d $test_pdir/ra/.git ]] + +echo "# pkg add (already installed)" +! pkg add ra + +repeat 2 { + echo "# pkg list" + stringcmp "core\nra" "$(pkg list local)" + stringcmp "rb\nrc" "$(pkg list not-installed)" + stringcmp "core\nra\nrb\nrc" "$(pkg list remote)" + pkg update +} + rm -rf $test_pdir $test_proot $test_home print -P '%F{green} test passed%F{default}' -- cgit v1.2.3