diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2021-12-09 00:11:05 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-13 10:29:48 -0800 |
commit | 0849541268a3aca9381591aed87b6864a203709b (patch) | |
tree | 00aa5e565425fd234928d17ad17e91c521d01d38 /t/t1020-subdirectory.sh | |
parent | tests: simplify construction of large blocks of text (diff) | |
download | tgif-0849541268a3aca9381591aed87b6864a203709b.tar.xz |
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/t1020-subdirectory.sh')
-rwxr-xr-x | t/t1020-subdirectory.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh index da19c06fb5..9fdbb2af80 100755 --- a/t/t1020-subdirectory.sh +++ b/t/t1020-subdirectory.sh @@ -11,9 +11,9 @@ test_description='Try various core-level commands in subdirectory. test_expect_success setup ' long="a b c d e f g h i j k l m n o p q r s t u v w x y z" && - for c in $long; do echo $c; done >one && + test_write_lines $long >one && mkdir dir && - for c in x y z $long a b c; do echo $c; done >dir/two && + test_write_lines x y z $long a b c >dir/two && cp one original.one && cp dir/two original.two ' |