Re: Re: [PATCH] ls-files: update test style
Show 25 quoted lines
>"Li Linchao via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> diff --git a/t/README b/t/README
>> index 309a31133c6..70205fba41b 100644
>> --- a/t/README
>> +++ b/t/README
>> @@ -560,6 +560,21 @@ Here are the "do's:"
>> Even code that isn't a test per se, but merely some setup code
>> should be inside a test assertion.
>>
>> + - Keep test title the same line with test helper function itself,
>> + and end the line with a single quote.
>> +
>> + Take test_expect_success helper for example, write it like:
>> +
>> + test_expect_success 'test title to describe this test case' '
>> + # test body
>> + '
>
>If you want to show the pretty layout, then the test body should
>be shown indented, i.e.
>
> test_expect_success 'title' '
> ... test body ...
> '
Show 6 quoted lines
>
>But I am not sure if this belongs to the existing "Do's and don'ts"
>section, which lists tips that matter for correctness.
>
>This new one certainly encouraged as a more modern style, but is not
>about correctness at all.
OK, I will remove it from "Do's and don'ts" section.
>
>A separate "recommended style" section might make sense, but there
>will be a lot more entries, like when to quote and not to quote EOF
>marker for here-document, indenting the body of here-document, etc.
Yes, a "recommended style" section needed.