From 6b89c3d5b89e12154ab859ce64265db0c33303f8 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sat, 2 Jun 2018 14:29:05 +0200 Subject: [PATCH] improve tests --- tests-ng/dir-import-update.sh | 3 +++ tests-ng/duplicate-key.sh | 5 ++++- tests-ng/include.sh | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests-ng/dir-import-update.sh b/tests-ng/dir-import-update.sh index 93b2f18..16bff5e 100755 --- a/tests-ng/dir-import-update.sh +++ b/tests-ng/dir-import-update.sh @@ -65,7 +65,10 @@ echo "changed" > ${token} # update cd ${ddpath} | ${bin} update -f -c ${cfg} ${tmpd} +grep 'changed' ${token} >/dev/null 2>&1 + ## CLEANING rm -rf ${basedir} ${tmpd} +echo "OK" exit 0 diff --git a/tests-ng/duplicate-key.sh b/tests-ng/duplicate-key.sh index 16aaba9..afdbd8a 100755 --- a/tests-ng/duplicate-key.sh +++ b/tests-ng/duplicate-key.sh @@ -93,9 +93,12 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p2 \ ${tmpd}/sub/sub/abc \ ${tmpd}/sub/sub2/abc -cat ${cfg} +# count dotfiles for p2 +cnt=`cd ${ddpath} | ${bin} listfiles -c ${cfg} -p p2 -b | grep '^f_' | wc -l` +[ "${cnt}" != "4" ] && exit 1 ## CLEANING rm -rf ${tmps} ${tmpd} +echo "OK" exit 0 diff --git a/tests-ng/include.sh b/tests-ng/include.sh index 3add107..6165dce 100755 --- a/tests-ng/include.sh +++ b/tests-ng/include.sh @@ -83,7 +83,12 @@ cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 cd ${ddpath} | ${bin} compare -c ${cfg} -p p1 cd ${ddpath} | ${bin} compare -c ${cfg} -p p2 +# count +cnt=`cd ${ddpath} | ${bin} listfiles -c ${cfg} -p p1 -b | grep '^f_' | wc -l` +[ "${cnt}" != "1" ] && exit 1 + ## CLEANING rm -rf ${tmps} ${tmpd} +echo "OK" exit 0