diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2021-12-09 06:11:05 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-13 19:29:48 +0100 |
commit | 0849541268a3aca9381591aed87b6864a203709b (patch) | |
tree | 00aa5e565425fd234928d17ad17e91c521d01d38 /t/t4019-diff-wserror.sh | |
parent | tests: simplify construction of large blocks of text (diff) | |
download | git-0849541268a3aca9381591aed87b6864a203709b.tar.xz git-0849541268a3aca9381591aed87b6864a203709b.zip |
tests: use test_write_lines() to generate line-oriented output
Take advantage of test_write_lines() to generate line-oriented output
rather than using for-loops or a series of `echo` commands. Not only is
test_write_lines() a natural fit for such a task, but there is less
opportunity for a broken &&-chain.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4019-diff-wserror.sh')
-rwxr-xr-x | t/t4019-diff-wserror.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh index c68729ac09..d2b3109c2d 100755 --- a/t/t4019-diff-wserror.sh +++ b/t/t4019-diff-wserror.sh @@ -287,9 +287,9 @@ test_expect_success 'do not color trailing cr in context' ' ' test_expect_success 'color new trailing blank lines' ' - { echo a; echo b; echo; echo; } >x && + test_write_lines a b "" "" >x && git add x && - { echo a; echo; echo; echo; echo c; echo; echo; echo; echo; } >x && + test_write_lines a "" "" "" c "" "" "" "" >x && git diff --color x >output && cnt=$($grep_a "${blue_grep}" output | wc -l) && test $cnt = 2 |