Message ID | 20230202171821.10508-2-cheskaqiqi@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | t4113: modernize test style | expand |
Shuqi Liang <cheskaqiqi@gmail.com> writes: The example Andrei gave you, i.e. Test scripts in file t4113-apply-ending.sh are written in old style, where the test_expect_success command and test title are written on separate lines ... was quite readable, but this > Change the old style '\' to new style "'" is almost impossible to understand without knowing that this wanted to say what Andrei gave in a different way. The title is worse. It's not replacing a backslash with a single quote, which would result in -test_expect_success setup \ +test_expect_success setup ' 'git update-index --add file' and obviously that is not what you did (or wanted to do). > Signed-off-by: Shuqi Liang <cheskaqiqi@gmail.com> > --- > t/t4113-apply-ending.sh | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) The patch text looks OK.
Hi Junio, On Thu, Feb 2, 2023 at 4:00 PM Junio C Hamano <gitster@pobox.com> wrote: > is almost impossible to understand without knowing that this wanted > to say what Andrei gave in a different way. The title is worse. > It's not replacing a backslash with a single quote, which would > result in > > -test_expect_success setup \ > +test_expect_success setup ' > 'git update-index --add file' > > and obviously that is not what you did (or wanted to do). Thanks, I will modify it to make it clear about my motivation and the real changes to my patch.
diff --git a/t/t4113-apply-ending.sh b/t/t4113-apply-ending.sh index 66fa51591e..aa57895b22 100755 --- a/t/t4113-apply-ending.sh +++ b/t/t4113-apply-ending.sh @@ -24,13 +24,14 @@ echo 'a' >file echo 'b' >>file echo 'c' >>file -test_expect_success setup \ - 'git update-index --add file' - +test_expect_success setup ' + git update-index --add file +' # test -test_expect_success 'apply at the end' \ - 'test_must_fail git apply --index test-patch' +test_expect_success 'apply at the end' ' + test_must_fail git apply --index test-patch +' cat >test-patch <<\EOF diff a/file b/file @@ -47,7 +48,8 @@ b c' git update-index file -test_expect_success 'apply at the beginning' \ - 'test_must_fail git apply --index test-patch' +test_expect_success 'apply at the beginning' ' + test_must_fail git apply --index test-patch +' test_done
Change the old style '\' to new style "'" Signed-off-by: Shuqi Liang <cheskaqiqi@gmail.com> --- t/t4113-apply-ending.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)