mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 16:49:42 +00:00
improve comparison
This commit is contained in:
2
tests-ng/chmod-compare.sh
vendored
2
tests-ng/chmod-compare.sh
vendored
@@ -92,6 +92,7 @@ _EOF
|
||||
cd "${ddpath}" | ${bin} install -f -c "${cfg}" -p p1
|
||||
|
||||
# compare
|
||||
echo "compare after install..."
|
||||
cd "${ddpath}" | ${bin} compare -c "${cfg}" -p p1
|
||||
|
||||
# import
|
||||
@@ -109,6 +110,7 @@ chmod 700 "${fnormal}"
|
||||
chmod 700 "${flink}"
|
||||
|
||||
set +e
|
||||
cd "${ddpath}" | ${bin} compare -c "${cfg}" -p p1 -V
|
||||
out=$(cd "${ddpath}" | ${bin} compare -c "${cfg}" -p p1 2>&1)
|
||||
cnt=$(echo "${out}" | grep 'modes differ' | wc -l)
|
||||
set -e
|
||||
|
||||
7
tests-ng/compare-negative-ignore-relative.sh
vendored
7
tests-ng/compare-negative-ignore-relative.sh
vendored
@@ -66,8 +66,7 @@ cd "${ddpath}" | ${bin} compare -c "${cfg}" --verbose --ignore="${patt0}" --igno
|
||||
[ "$?" = "0" ] && exit 1
|
||||
cnt=$(cd "${ddpath}" | ${bin} compare -c "${cfg}" --ignore="${patt0}" --ignore=${patt1} | grep '^=> diff' | wc -l)
|
||||
set -e
|
||||
|
||||
[ "${cnt}" != "2" ] && echo "bad number of diffs: ${cnt}/2" && exit 1
|
||||
[ "${cnt}" != "2" ] && echo "bad number of diffs (1): ${cnt}/2" && exit 1
|
||||
|
||||
########################################
|
||||
# Test ignores specified in config.yaml
|
||||
@@ -101,7 +100,7 @@ cd "${ddpath}" | ${bin} compare -c "${cfg}" --verbose -C "${tmpd}"/.zsh --ignore
|
||||
cnt=$(cd "${ddpath}" | ${bin} compare -c "${cfg}" -C "${tmpd}"/.zsh --ignore="${patt0}" --ignore=${patt1} | grep 'does not exist in dotdrop$' | wc -l)
|
||||
set -e
|
||||
|
||||
[ "${cnt}" != "1" ] && echo "bad number of diffs: ${cnt}/1" && exit 1
|
||||
[ "${cnt}" != "1" ] && echo "bad number of diffs (2): ${cnt}/1" && exit 1
|
||||
|
||||
# expects one diff
|
||||
echo "[+] comparing .zsh with ignore in dotfile - expect 1 diff"
|
||||
@@ -111,6 +110,6 @@ cd "${ddpath}" | ${bin} compare -c "${cfg2}" --verbose -C "${tmpd}"/.zsh
|
||||
cnt=$(cd "${ddpath}" | ${bin} compare -c "${cfg2}" -C "${tmpd}"/.zsh | grep 'does not exist in dotdrop$' | wc -l)
|
||||
set -e
|
||||
|
||||
[ "${cnt}" != "1" ] && echo "bad number of diffs: ${cnt}/1" && exit 1
|
||||
[ "${cnt}" != "1" ] && echo "bad number of diffs (3): ${cnt}/1" && exit 1
|
||||
|
||||
echo "OK"
|
||||
|
||||
Reference in New Issue
Block a user