summaryrefslogtreecommitdiff
path: root/t/t4124-apply-ws-rule.sh
diff options
context:
space:
mode:
authorGary V. Vaughan <git@mlists.thewrittenword.com>2010-05-14 09:31:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-31 23:59:27 (GMT)
commit4fdf71be1ca3a817851a14f91b75e7d30f885a48 (patch)
tree5e280e04305b3b1f019ce56e4293a01b77d152a2 /t/t4124-apply-ws-rule.sh
parentd1b1a919461c2f00d4e10f5ba227b13f800a6ac3 (diff)
downloadgit-4fdf71be1ca3a817851a14f91b75e7d30f885a48.zip
git-4fdf71be1ca3a817851a14f91b75e7d30f885a48.tar.gz
git-4fdf71be1ca3a817851a14f91b75e7d30f885a48.tar.bz2
tests: use "test_cmp", not "diff", when verifying the result
In tests, call test_cmp rather than raw diff where possible (i.e. if the output does not go to a pipe), to allow the use of, say, 'cmp' when the default 'diff -u' is not compatible with a vendor diff. When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS. Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4124-apply-ws-rule.sh')
-rwxr-xr-xt/t4124-apply-ws-rule.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh
index fb9ad24..bef3bcb 100755
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -44,7 +44,7 @@ test_fix () {
apply_patch --whitespace=fix || return 1
# find touched lines
- diff file target | sed -n -e "s/^> //p" >fixed
+ $DIFF file target | sed -n -e "s/^> //p" >fixed
# the changed lines are all expeced to change
fixed_cnt=$(wc -l <fixed)
@@ -85,14 +85,14 @@ test_expect_success setup '
test_expect_success 'whitespace=nowarn, default rule' '
apply_patch --whitespace=nowarn &&
- diff file target
+ test_cmp file target
'
test_expect_success 'whitespace=warn, default rule' '
apply_patch --whitespace=warn &&
- diff file target
+ test_cmp file target
'
@@ -108,7 +108,7 @@ test_expect_success 'whitespace=error-all, no rule' '
git config core.whitespace -trailing,-space-before,-indent &&
apply_patch --whitespace=error-all &&
- diff file target
+ test_cmp file target
'
@@ -117,7 +117,7 @@ test_expect_success 'whitespace=error-all, no rule (attribute)' '
git config --unset core.whitespace &&
echo "target -whitespace" >.gitattributes &&
apply_patch --whitespace=error-all &&
- diff file target
+ test_cmp file target
'