From 82ebb0b6ec7470cab96a013d3d719c109003ef83 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 12 Mar 2008 17:36:36 -0400 Subject: add test_cmp function for test scripts Many scripts compare actual and expected output using "diff -u". This is nicer than "cmp" because the output shows how the two differ. However, not all versions of diff understand -u, leading to unnecessary test failure. This adds a test_cmp function to the test scripts and switches all "diff -u" invocations to use it. The function uses the contents of "$GIT_TEST_CMP" to compare its arguments; the default is "diff -u". On systems with a less-capable diff, you can do: GIT_TEST_CMP=cmp make test Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t3201-branch-contains.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't/t3201-branch-contains.sh') diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh index 9ef593f0e1..b4cf628d22 100755 --- a/t/t3201-branch-contains.sh +++ b/t/t3201-branch-contains.sh @@ -31,7 +31,7 @@ test_expect_success 'branch --contains=master' ' { echo " master" && echo "* side" } >expect && - diff -u expect actual + test_cmp expect actual ' @@ -41,7 +41,7 @@ test_expect_success 'branch --contains master' ' { echo " master" && echo "* side" } >expect && - diff -u expect actual + test_cmp expect actual ' @@ -51,7 +51,7 @@ test_expect_success 'branch --contains=side' ' { echo "* side" } >expect && - diff -u expect actual + test_cmp expect actual ' -- cgit v1.2.3