When I run this test and it fails:
func TestCaseA(t *testing.T){
t.Run("my name with spaces", func (t *testing.T){
t.Error("some error message")
})
}
then the name of the test is modified (spaces are changed to underscores) in the output:
--- FAIL: TestCaseA (0.00s)
--- FAIL: TestCaseA/my_name_with_spaces (0.00s)
main.go:10: some error message
FAIL
Why does it do this?
Here's a working example: https://play.golang.org/p/viZjC60Dazg
Aucun commentaire:
Enregistrer un commentaire