You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/contributor/pages/code-style-guide.adoc
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -600,9 +600,15 @@ let memory: CpuQuantity = "2".parse();
600
600
601
601
=== Unit test function names
602
602
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`.
606
612
607
613
[TIP.code-rule,caption=Examples of correct code for this rule]
0 commit comments