Skip to content

Commit

Permalink
t/t7500-commit.sh: use test_cmp instead of test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ævar Arnfjörð Bjarmason authored and Junio C Hamano committed Feb 21, 2011
1 parent 49151d8 commit d5a719e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion t/t7500-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d5a719e

Please sign in to comment.