Skip to contentSkip to conversation

t/t7500-commit.sh: use test_cmp instead of test

PATCH New Ævar Arnfjörð Bjarmason 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t/t7500-commit.sh: use test_cmp instead of test

Change commit_msg_is() in t/t7500-commit.sh to use test_cmp instead of the shell's test function. Now if a test fails we'll get test_cmp output showing us what failed.

---
 t/t7500-commit.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
t/t7500-commit.sh +6 -1
index 162527c..d551b77 100755
@@ -10,7 +10,12 @@ Tests for selected commit options.'
 . ./test-lib.sh
 
 commit_msg_is () {
-	test "`git log --pretty=format:%s%b -1`" = "$1"
+	expect=commit_msg_is.expect
+	actual=commit_msg_is.actual
+
+	printf "%s" "$(git log --pretty=format:%s%b -1)" >$expect &&
+	printf "%s" "$1" >$actual &&
+	test_cmp $expect $actual
 }
 
 # A sanity check to see if commit is working at all.
Signature · 1 line
1.7.2.3