Skip to content

Commit 2b493e6

Browse files
Update modules/contributor/pages/code-style-guide.adoc
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
1 parent db164f4 commit 2b493e6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

modules/contributor/pages/code-style-guide.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,15 @@ let memory: CpuQuantity = "2".parse();
600600

601601
=== Unit test function names
602602

603-
Function names of unit tests must not include the `test_` prefix, because otherwise `cargo test` will produce superfluous output like `memory::test::test_addition::case_1`.
604-
Instead, use an appropriate name to describe what is being tested.
605-
The previously mentioned name could for example be renamed to `memory::test::addition::case_1`.
603+
Function names of unit tests must not include a redundant `test` prefix or
604+
suffix.
605+
606+
It results in the output of `cargo test` containing superfluous mentions of
607+
"test", especially when the containing module is called `test`. For example:
608+
`my_crate::test::test_valid`.
609+
610+
Instead, use an appropriate name to describe what is being tested. The previous
611+
example could then become: `my_crate::test::parse_valid_api_version`.
606612

607613
[TIP.code-rule,caption=Examples of correct code for this rule]
608614
====

0 commit comments

Comments
 (0)