Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2021-03-04 17:51:16 +0300
committerToon Claes <toon@gitlab.com>2021-03-08 18:44:32 +0300
commit7fa2bf50e05469ef23624a2dc22b079171918778 (patch)
treeb71a8548bdbe73f9668bb5635fdd505b40c889f7 /STYLE.md
parent9ac2019d7b07a0d669780b6e3fee60a543226a7a (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.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/STYLE.md b/STYLE.md
index 64319a6b7..a67515d6a 100644
--- a/STYLE.md
+++ b/STYLE.md
@@ -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