From 56a707183b9ea3e5d2e868225f52236ade4f6728 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 15 Jul 2021 10:36:28 +0200 Subject: [PATCH] fix tests --- tests-ng/actions-empty-dir.sh | 7 ++----- tests-ng/install-link-children.sh | 10 +++++----- tests-ng/transformations.sh | 2 ++ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tests-ng/actions-empty-dir.sh b/tests-ng/actions-empty-dir.sh index 7137aa2..6e4d8de 100755 --- a/tests-ng/actions-empty-dir.sh +++ b/tests-ng/actions-empty-dir.sh @@ -7,7 +7,7 @@ # # exit on first error -set -e +set -ev # all this crap to get current path rl="readlink -f" @@ -151,8 +151,7 @@ grep "file" ${tmpd}/dir1/not-empty/file [ ! -d ${tmpd}/dir2/not-empty ] && exit 1 [ ! -h ${tmpd}/dir2/not-empty ] && exit 1 [ ! -e ${tmpd}/dir2/not-empty/file ] && exit 1 -[ ! -d ${tmpd}/dir2/sub ] && exit 1 -[ ! -h ${tmpd}/dir2/sub ] && exit 1 +[ -d ${tmpd}/dir2/sub ] && exit 1 [ -d ${tmpd}/dir2/sub/empty ] && exit 1 [ -e ${tmpd}/dir2/sub/empty/that.ignore ] && exit 1 grep "p1" ${tmpd}/dir2/not-empty/file @@ -172,8 +171,6 @@ grep "p1" ${tmpd}/dir3/not-empty/file # second install won't trigger the action cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -V # 2>&1 | tee ${tmpa}/log -set -e - # check normal [ -d ${tmpd}/dir1/empty ] && echo "empty directory not cleaned" && exit 1 [ -d ${tmpd}/dir1/sub/empty ] && echo "empty directory not cleaned" && exit 1 diff --git a/tests-ng/install-link-children.sh b/tests-ng/install-link-children.sh index bfb6dea..fa0d10a 100755 --- a/tests-ng/install-link-children.sh +++ b/tests-ng/install-link-children.sh @@ -7,7 +7,7 @@ # # exit on first error -set -e +set -ev # all this crap to get current path rl="readlink -f" @@ -90,11 +90,11 @@ echo "{{@@ profile @@}}" > ${tmps}/dotfiles/dir1/sub/empty/that.ignore cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 -V #cat ${cfg} -# checks normal +# check normal [ ! -d ${tmpd}/dir1 ] && exit 1 -[ ! -d ${tmpd}/dir1/empty ] && exit 1 -[ ! -d ${tmpd}/dir1/sub ] && exit 1 -[ ! -d ${tmpd}/dir1/sub/empty ] && exit 1 +[ -d ${tmpd}/dir1/empty ] && exit 1 +[ -d ${tmpd}/dir1/sub ] && exit 1 +[ -d ${tmpd}/dir1/sub/empty ] && exit 1 [ ! -d ${tmpd}/dir1/not-empty ] && exit 1 [ ! -e ${tmpd}/dir1/not-empty/file ] && exit 1 diff --git a/tests-ng/transformations.sh b/tests-ng/transformations.sh index 470e63e..93d18f6 100755 --- a/tests-ng/transformations.sh +++ b/tests-ng/transformations.sh @@ -118,6 +118,8 @@ echo ${tokend} > ${tmpx}/a/somefile echo ${tokend} > ${tmpx}/b/somefile echo ${tokend} > ${tmpx}/c/somefile echo ${tokend} > ${tmpx}/a/dir1/otherfile +# create a fake file to ensure dir is created +echo ${tokend} > ${tmpx}/a/dir2/token tar -cf ${tmps}/dotfiles/ghi -C ${tmpx} . rm -rf ${tmpx} tar -tf ${tmps}/dotfiles/ghi