Open applejag opened 3 years ago
Our unit tests are not that coherent in their names. We use a mix of different naming conventions, as they are written by different developers.
The simple answer is just to name them:
func Test{NameOfTypeOrFunction}(t *testing.T) // Example func Add(a, b int) int func TestAdd(t *testing.T)
But it gets diffuse when we start having multiple tests targetting the same function/type/method but with slight variations.
An example format of this (though not that great IMO):
func Test{NameOfTypeOrFunction}_{StateOfType}_{ExpectedResult}(t *testing.T) func TestAdd_GivenNegativeValues_ReturnsNegative(t *testing.T)
Suggest to write an RFC of this.
Our unit tests are not that coherent in their names. We use a mix of different naming conventions, as they are written by different developers.
The simple answer is just to name them:
But it gets diffuse when we start having multiple tests targetting the same function/type/method but with slight variations.
An example format of this (though not that great IMO):
Suggest to write an RFC of this.