tests: simplify by dropping unnecessary for loops

Rather than manually looping over a set of items and plugging those
items into a template string which is printed repeatedly, achieve the
same effect by taking advantage of `printf` which loops over its
arguments automatically.

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:11 -05:00
committed by Junio C Hamano
parent 03949e33f5
commit efe26b9ee0
7 changed files with 14 additions and 50 deletions

View File

@ -591,7 +591,7 @@ test_expect_success 'cvs annotate' '
cd cvswork &&
GIT_CONFIG="$git_config" cvs annotate merge >../out &&
sed -e "s/ .*//" ../out >../actual &&
for i in 3 1 1 1 1 1 1 1 2 4; do echo 1.$i; done >../expect &&
printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect &&
test_cmp ../expect ../actual
'