@matheusbsbs / matheus-bagliano / commits / d5a719e4af
Fork 0

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. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 19, 2011 at 18:29 UTC d5a719e4afbfd74cf5ccf94c2a5b27aa5d06e914
1 file changed +6 -1
t/t7500-commit.sh
+6 -1
@@ -10,7 +10,12 @@ Tests for selected commit options.'
10 . ./test-lib.sh
11
12 commit_msg_is () {
13 - test "`git log --pretty=format:%s%b -1`" = "$1"
13 + expect=commit_msg_is.expect
14 + actual=commit_msg_is.actual
15 +
16 + printf "%s" "$(git log --pretty=format:%s%b -1)" >$expect &&
17 + printf "%s" "$1" >$actual &&
18 + test_cmp $expect $actual
19 }
20
21 # A sanity check to see if commit is working at all.