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>
This commit is contained in:
Eric Sunshine
2021-12-09 00:11:05 -05:00
committed by Junio C Hamano
parent 020b813f40
commit 0849541268
26 changed files with 106 additions and 170 deletions

View File

@ -23,7 +23,7 @@ test_expect_success basics '
test_cmp expect actual &&
git update-index --add one two three &&
for i in one three two; do echo $i; done >expect &&
test_write_lines one three two >expect &&
git ls-files >actual &&
test_cmp expect actual &&