diff options
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 |