t7600: use test_write_lines()
In t7600, we were rewriting `printf '%s\n' ...` to create files from parameters, one per line. However, we already have a function that wraps this for us: test_write_lines(). Rewrite these instances to use that function instead of open coding it. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
805d9eaf5e
commit
fd6852cab2
@ -29,15 +29,15 @@ Testing basic merge operations/option parsing.
|
|||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-gpg.sh
|
. "$TEST_DIRECTORY"/lib-gpg.sh
|
||||||
|
|
||||||
printf '%s\n' 1 2 3 4 5 6 7 8 9 >file
|
test_write_lines 1 2 3 4 5 6 7 8 9 >file
|
||||||
printf '%s\n' '1 X' 2 3 4 5 6 7 8 9 >file.1
|
test_write_lines '1 X' 2 3 4 5 6 7 8 9 >file.1
|
||||||
printf '%s\n' 1 2 3 4 '5 X' 6 7 8 9 >file.5
|
test_write_lines 1 2 3 4 '5 X' 6 7 8 9 >file.5
|
||||||
printf '%s\n' 1 2 3 4 5 6 7 8 '9 X' >file.9
|
test_write_lines 1 2 3 4 5 6 7 8 '9 X' >file.9
|
||||||
printf '%s\n' 1 2 3 4 5 6 7 8 '9 Y' >file.9y
|
test_write_lines 1 2 3 4 5 6 7 8 '9 Y' >file.9y
|
||||||
printf '%s\n' '1 X' 2 3 4 5 6 7 8 9 >result.1
|
test_write_lines '1 X' 2 3 4 5 6 7 8 9 >result.1
|
||||||
printf '%s\n' '1 X' 2 3 4 '5 X' 6 7 8 9 >result.1-5
|
test_write_lines '1 X' 2 3 4 '5 X' 6 7 8 9 >result.1-5
|
||||||
printf '%s\n' '1 X' 2 3 4 '5 X' 6 7 8 '9 X' >result.1-5-9
|
test_write_lines '1 X' 2 3 4 '5 X' 6 7 8 '9 X' >result.1-5-9
|
||||||
printf '%s\n' 1 2 3 4 5 6 7 8 '9 Z' >result.9z
|
test_write_lines 1 2 3 4 5 6 7 8 '9 Z' >result.9z
|
||||||
|
|
||||||
create_merge_msgs () {
|
create_merge_msgs () {
|
||||||
echo "Merge tag 'c2'" >msg.1-5 &&
|
echo "Merge tag 'c2'" >msg.1-5 &&
|
||||||
@ -81,7 +81,7 @@ verify_head () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
verify_parents () {
|
verify_parents () {
|
||||||
printf '%s\n' "$@" >parents.expected &&
|
test_write_lines "$@" >parents.expected &&
|
||||||
>parents.actual &&
|
>parents.actual &&
|
||||||
i=1 &&
|
i=1 &&
|
||||||
while test $i -le $#
|
while test $i -le $#
|
||||||
@ -95,7 +95,7 @@ verify_parents () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
verify_mergeheads () {
|
verify_mergeheads () {
|
||||||
printf '%s\n' "$@" >mergehead.expected &&
|
test_write_lines "$@" >mergehead.expected &&
|
||||||
while read sha1 rest
|
while read sha1 rest
|
||||||
do
|
do
|
||||||
git rev-parse $sha1
|
git rev-parse $sha1
|
||||||
|
Loading…
Reference in New Issue
Block a user