diff options
author | Toon Claes <toon@gitlab.com> | 2021-03-04 17:51:16 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2021-03-08 18:44:32 +0300 |
commit | 7fa2bf50e05469ef23624a2dc22b079171918778 (patch) | |
tree | b71a8548bdbe73f9668bb5635fdd505b40c889f7 /STYLE.md | |
parent | 9ac2019d7b07a0d669780b6e3fee60a543226a7a (diff) |
style: Document camelCasing in test name suffix
When a test name suffix consists of multiple words camelCasing should be
used to indicate separation of words.
Diffstat (limited to 'STYLE.md')
-rw-r--r-- | STYLE.md | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -177,17 +177,21 @@ A type should be declared before its first use. Prefer to name tests in the same style as [examples](https://golang.org/pkg/testing/#hdr-Examples). To declare a test for the package, a function F, a type T and method M on type T are: -``` + +```go func TestF() { ... } func TestT() { ... } func TestT_M() { ... } ``` -A suffix may be appended to distinguish between test cases. The suffix must start with a lower-case letter. -``` +A suffix may be appended to distinguish between test cases. The suffix must +start with a lower-case letter and use camelCasing to separate words. + +```go func TestF_suffix() { ... } func TestT_suffix() { ... } func TestT_M_suffix() { ... } +func TestT_M_suffixWithMultipleWords() { ... } ``` ### Table-driven tests |