From 23024271cd30edc06510f35e1dd0da4bf4c1212a Mon Sep 17 00:00:00 2001 From: David Date: Wed, 20 Dec 2017 13:33:22 +0800 Subject: [PATCH] add simple explanation about test cases --- internal/render/templates/function.tmpl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/render/templates/function.tmpl b/internal/render/templates/function.tmpl index fa1e59cd..38651c3b 100644 --- a/internal/render/templates/function.tmpl +++ b/internal/render/templates/function.tmpl @@ -39,7 +39,14 @@ func {{.TestName}}(t *testing.T) { wantErr bool {{- end}} }{ - // TODO: Add test cases. + // TODO: Add test cases. + + // tips: + // func example() string { return "result"} + // test case eg: {"example","result"}, --> test will be ok + // test case eg: {"example","error result "}, --> test will be failed + // more detail in the gif --> https://github.com/cweill/GoTests-Sublime/raw/master/gotests.gif + } for {{if not .IsNaked}} _, tt := {{end}} range tests { {{- if .Subtests }}t.Run(tt.name, func(t *testing.T) { {{- end -}}