summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-03-28 13:37:57 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-03-28 13:37:57 +0200
commit3fa58765e39d64c03a69abc9b1bbcac014e18b9e (patch)
tree74a9cc1caca3970cb123221be558d2ea9d9f2180
parentfbad737b8caa94a49fa191ec1da4d5f5f2e7fd70 (diff)
Add auto stuff to checklinks tests
-rw-r--r--test/checklinks82
1 files changed, 82 insertions, 0 deletions
diff --git a/test/checklinks b/test/checklinks
index 53d36c6..9c2894d 100644
--- a/test/checklinks
+++ b/test/checklinks
@@ -33,3 +33,85 @@ echo "# checklinks: link source exists already"
echo exists > link
! checklinks
[[ $(cat link) == exists ]]
+
+rm bar file flurbl foo link blub
+mkdir ~/cl
+cd ~/cl
+
+echo "# checklinks: auto (normal files)"
+
+echo auto > links
+touch n1 n2
+checklinks
+
+[[ -e ~/.n1 ]]
+[[ -e ~/.n2 ]]
+
+checklinks --remove
+
+[[ ! -e ~/.n1 ]]
+[[ ! -e ~/.n2 ]]
+
+echo "# checkliks: auto (normal files + dotfiles)"
+
+touch .d1 .d2
+checklinks
+
+[[ -e ~/.d1 ]]
+[[ -e ~/.d2 ]]
+[[ ! -e ~/.n1 ]]
+[[ ! -e ~/.n2 ]]
+[[ ! -e ~/n1 ]]
+[[ ! -e ~/n2 ]]
+
+checklinks --remove
+
+[[ ! -e ~/.d1 ]]
+[[ ! -e ~/.d2 ]]
+
+echo "# checklinks: auto (dotfiles)"
+
+rm n1 n2
+checklinks
+
+[[ -e ~/.d1 ]]
+[[ -e ~/.d2 ]]
+
+checklinks --remove
+
+[[ ! -e ~/.d1 ]]
+[[ ! -e ~/.d2 ]]
+
+rm links
+
+echo "# checklinks: --ct-auto (no etc)"
+
+touch foo bar
+checklinks --ct-auto
+
+[[ ! -e ~/.foo ]]
+[[ ! -e ~/.bar ]]
+
+echo "# checklinks: --ct-auto (etc with links file)"
+
+touch links
+checklinks --ct-auto
+
+[[ ! -e ~/.foo ]]
+[[ ! -e ~/.bar ]]
+
+rm links
+
+echo "# checklinks: --ct-auto (etc with files)"
+
+mkdir etc
+touch etc/{the,dude}
+checklinks --ct-auto
+
+[[ -e ~/.the ]]
+[[ -e ~/.dude ]]
+
+checklinks --ct-auto --remove
+
+[[ ! -e ~/.the ]]
+[[ ! -e ~/.dude ]]