From: Junio C Hamano <gitster@pobox.com>
To: "Li Linchao via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Li Linchao <lilinchao@oschina.cn>
Subject: Re: [PATCH] ls-files: update test style
Date: Thu, 23 Jun 2022 10:09:48 -0700 [thread overview]
Message-ID: <xmqq5ykr1f37.fsf@gitster.g> (raw)
In-Reply-To: <pull.1269.git.1655974015414.gitgitgadget@gmail.com> (Li Linchao via GitGitGadget's message of "Thu, 23 Jun 2022 08:46:55 +0000")
"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 ...
'
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.
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.
next prev parent reply other threads:[~2022-06-23 17:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 8:46 [PATCH] ls-files: update test style Li Linchao via GitGitGadget
2022-06-23 10:50 ` Ævar Arnfjörð Bjarmason
2022-06-24 4:57 ` lilinchao
2022-06-23 17:09 ` Junio C Hamano [this message]
2022-06-24 5:05 ` lilinchao
2022-06-28 9:14 ` [PATCH v2] " Li Linchao via GitGitGadget
2022-06-28 9:51 ` [PATCH v3] " Li Linchao via GitGitGadget
2022-06-28 20:12 ` Junio C Hamano
2022-06-29 7:12 ` lilinchao
2022-06-30 15:54 ` Junio C Hamano
2022-06-30 5:59 ` [PATCH v4] " Li Linchao via GitGitGadget
2022-07-01 11:03 ` [PATCH v5] " Li Linchao via GitGitGadget
2022-07-01 21:46 ` Junio C Hamano
2022-07-03 15:49 ` [PATCH v6] " Li Linchao via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq5ykr1f37.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=lilinchao@oschina.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.