1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins

This commit is contained in:
Amir Salihefendic
2018-09-24 21:40:17 -03:00
parent 6bd9eda8c3
commit a6b64938eb
199 changed files with 2897 additions and 980 deletions

View File

@ -363,6 +363,28 @@ func Test${1:Function}(t *testing.T) {
}
endsnippet
# test table snippet
snippet tt
var tests = []struct {
name string
expected string
given string
}{
{"${1}", "${2}", "${3}",},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T){
actual := ${0:${VISUAL}}(tt.given)
if actual != tt.expected {
t.Errorf("$0(%s): expected %s, actual %s", tt.given, tt.expected, actual)
}
})
}
endsnippet
snippet hf "http.HandlerFunc" !b
func ${1:handler}(w http.ResponseWriter, r *http.Request) {
${0:fmt.Fprintf(w, "hello world")}

View File

@ -0,0 +1,17 @@
var tests = []struct {
name string
expected string
given string
}{
{"", "", "",},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T){
actual := {{++}}(tt.given)
if actual != tt.expected {
t.Errorf("{{+~\~1+}}(%s): expected %s, actual %s", tt.given, tt.expected, actual)
}
})
}

View File

@ -315,6 +315,25 @@ abbr func TestXYZ(t *testing.T) { ... }
func Test${1:Function}(t *testing.T) {
${0}
}
# test table snippet
snippet tt
abbr var test = {...}{...} for {t.Run(){...}}
var tests = []struct {
name string
expected string
given string
}{
{"${2}", "${3}", "${4}",},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T){
actual := ${1:Function}(tt.given)
if actual != tt.expected {
t.Errorf("given(%s): expected %s, actual %s", tt.given, tt.expected, actual)
}
})
}
# test server
snippet tsrv
abbr ts := httptest.NewServer(...)