aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroaki Sano <hiroaki.sano.9stories@gmail.com>2020-01-27 23:06:44 +0900
committerHiroaki Sano <hiroaki.sano.9stories@gmail.com>2020-01-27 23:54:13 +0900
commit23716b7b708853a51b585e0a2f8c7bbc5e09d2a9 (patch)
tree65c3641c93c875ca5249fc761d38e4e4fa7dc926
parentac26968d9e3957718192c4b32721e1c386dfb14f (diff)
downloadvim-sonictemplate-23716b7b708853a51b585e0a2f8c7bbc5e09d2a9.tar.gz
vim-sonictemplate-23716b7b708853a51b585e0a2f8c7bbc5e09d2a9.tar.bz2
vim-sonictemplate-23716b7b708853a51b585e0a2f8c7bbc5e09d2a9.zip
Add table driven testing for go
-rw-r--r--template/go/snip-test-table-driven.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/template/go/snip-test-table-driven.go b/template/go/snip-test-table-driven.go
new file mode 100644
index 0000000..f98786d
--- /dev/null
+++ b/template/go/snip-test-table-driven.go
@@ -0,0 +1,19 @@
+func Test{{_cursor_}}(t *testing.T) {
+ tests := []struct{
+ name string
+ want int
+ }{
+ {
+ name: "case1",
+ want: 1,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T){
+ got := 1
+ if got != tt.want {
+ t.Fatalf("want %v, but %v:", tt.want, got)
+ }
+ })
+ }
+}