OSDN Git Service

t7507-commit-verbose: improve test coverage by testing number of diffs
authorPranit Bauva <pranit.bauva@gmail.com>
Thu, 5 May 2016 09:50:01 +0000 (15:20 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 May 2016 18:52:45 +0000 (11:52 -0700)
commitde45dbb8188ecbc74c1e8a95bf861c6acdda393d
treec5260a63cae1f889f30159064efef2ab29de47f5
parente0070e8bd575c069ddc0a469c43076290210e79e
t7507-commit-verbose: improve test coverage by testing number of diffs

Make the fake "editor" store output of grep in a file so that we can
see how many diffs were contained in the message and use them in
individual tests where ever it is required. A subsequent commit will
introduce scenarios where it is important to be able to exactly
determine how many diffs were present.

The fake "editor" is always made to succeed regardless of whether grep
found diff headers or not so that we don't have to use 'test_must_fail'
for which 'test_line_count = 0' is an easy substitute and also helps in
maintaining the consistency.

Also use write_script() to create the fake "editor".

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7507-commit-verbose.sh