From adc4581533cba49d9e364c0d11fdaea874c71bc3 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 27 Jan 2020 08:10:25 +0100 Subject: [PATCH] fix diff tests --- tests-ng/diff-cmd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests-ng/diff-cmd.sh b/tests-ng/diff-cmd.sh index 1956c26..ba4c650 100755 --- a/tests-ng/diff-cmd.sh +++ b/tests-ng/diff-cmd.sh @@ -78,24 +78,24 @@ echo "modified" > ${tmpd}/singlefile echo "[+] comparing with normal diff" set +e cd ${ddpath} | ${bin} compare -c ${cfg} 2>&1 | grep -v '=>' > ${tmpd}/normal -diff -r ${tmpd}/singlefile ${basedir}/dotfiles/${tmpd}/singlefile > ${tmpd}/real +diff -u -r ${tmpd}/singlefile ${basedir}/dotfiles/${tmpd}/singlefile > ${tmpd}/real set -e # verify #cat ${tmpd}/normal #cat ${tmpd}/real -diff ${tmpd}/normal ${tmpd}/real || exit 1 +diff <( tail -2 ${tmpd}/normal) <( tail -2 ${tmpd}/real) || exit 1 # adding unified diff cfg2="${basedir}/config2.yaml" -sed '/dotpath: dotfiles/a \ \ diff_command: "diff -u {0} {1}"' ${cfg} > ${cfg2} +sed '/dotpath: dotfiles/a \ \ diff_command: "diff -r {0} {1}"' ${cfg} > ${cfg2} #cat ${cfg2} # unified diff echo "[+] comparing with unified diff" set +e cd ${ddpath} | ${bin} compare -c ${cfg2} 2>&1 | grep -v '=>' | grep -v '^+++\|^---' > ${tmpd}/unified -diff -u ${tmpd}/singlefile ${basedir}/dotfiles/${tmpd}/singlefile | grep -v '^+++\|^---' > ${tmpd}/real +diff -r ${tmpd}/singlefile ${basedir}/dotfiles/${tmpd}/singlefile | grep -v '^+++\|^---' > ${tmpd}/real set -e # verify