Message ID | 20230202171821.10508-5-cheskaqiqi@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | t4113: modernize test style | expand |
Shuqi Liang <cheskaqiqi@gmail.com> writes: > t4113-apply-ending.sh used 4-column indent with > space,fix it in use tabs for indentation. Good, but end the sentence with a full-top with a space after it, and start the next sentence with a capital letter. > Signed-off-by: Shuqi Liang <cheskaqiqi@gmail.com> > --- > t/t4113-apply-ending.sh | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/t/t4113-apply-ending.sh b/t/t4113-apply-ending.sh > index d5b15e97d3..9e28c72355 100755 > --- a/t/t4113-apply-ending.sh > +++ b/t/t4113-apply-ending.sh > @@ -23,11 +23,11 @@ echo 'b' >>file > echo 'c' >>file > > test_expect_success setup ' > - git update-index --add file > + git update-index --add file > ' This is not wrong per se, but the modern style is to avoid having any executable lines outside test_expect_foo. I'd expect that the resulting script begins more like the attached. [PATCH 4/4] stops the conversion in the middle, which leaves funny taste in our mouth. Thanks. diff --git i/t/t4113-apply-ending.sh w/t/t4113-apply-ending.sh index 66fa51591e..9746f45898 100755 --- i/t/t4113-apply-ending.sh +++ w/t/t4113-apply-ending.sh @@ -8,24 +8,20 @@ test_description='git apply trying to add an ending line. ' . ./test-lib.sh -# setup - -cat >test-patch <<\EOF -diff --git a/file b/file ---- a/file -+++ b/file -@@ -1,2 +1,3 @@ - a - b -+c -EOF - -echo 'a' >file -echo 'b' >>file -echo 'c' >>file - -test_expect_success setup \ - 'git update-index --add file' +test_expect_success setup ' + cat >test-patch <<-\EOF + diff --git a/file b/file + --- a/file + +++ b/file + @@ -1,2 +1,3 @@ + a + b + +c + EOF + + test_write_lines a b c >file + git update-index --add file +' # test
On Thu, Feb 2, 2023 at 4:10 PM Junio C Hamano <gitster@pobox.com> wrote: > Good, but end the sentence with a full-top with a space after it, > and start the next sentence with a capital letter. Sure, think I need to change it to " ...space. Fix..". I will pay more attention to my English written style. > This is not wrong per se, but the modern style is to avoid having > any executable lines outside test_expect_foo. I'd expect that the > resulting script begins more like the attached. [PATCH 4/4] stops > the conversion in the middle, which leaves funny taste in our mouth. Thanks, Will avoid having any executable lines outside test_expect_foo. Overall, thanks for the reply and it is really helpful! -------------------------------- Shuqi
diff --git a/t/t4113-apply-ending.sh b/t/t4113-apply-ending.sh index d5b15e97d3..9e28c72355 100755 --- a/t/t4113-apply-ending.sh +++ b/t/t4113-apply-ending.sh @@ -23,11 +23,11 @@ echo 'b' >>file echo 'c' >>file test_expect_success setup ' - git update-index --add file + git update-index --add file ' test_expect_success 'apply at the end' ' - test_must_fail git apply --index test-patch + test_must_fail git apply --index test-patch ' test_expect_success 'setup for apply at the beginning' ' @@ -48,7 +48,7 @@ test_expect_success 'setup for apply at the beginning' ' ' test_expect_success 'apply at the beginning' ' - test_must_fail git apply --index test-patch + test_must_fail git apply --index test-patch ' test_done
t4113-apply-ending.sh used 4-column indent with space,fix it in use tabs for indentation. Signed-off-by: Shuqi Liang <cheskaqiqi@gmail.com> --- t/t4113-apply-ending.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)