Skip to content

Commit

Permalink
Merge pull request #3210 from qeubar/new_tRun_snippet
Browse files Browse the repository at this point in the history
Add a new snippet for t.Run
  • Loading branch information
bhcleek authored Apr 25, 2021
2 parents 87fd4bf + 6cab4cc commit 5db2f40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gosnippets/UltiSnips/go.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,13 @@ func Test${1:Function}(t *testing.T) {
}
endsnippet

# test t.Run
snippet tr "t.Run(XYZ, func(t *testing.T){ ... })"
t.Run("${0}", func(t *testing){

})
endsnippet

# test table snippet
snippet tt
var tests = []struct {
Expand Down
6 changes: 6 additions & 0 deletions gosnippets/snippets/go.snip
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ abbr func TestXYZ(t *testing.T) { ... }
func Test${1:Function}(t *testing.T) {
${0}
}
# test t.Run
snippet tr
abbr t.Run("test name", func(t *testing.T){ ... })
t.Run("${0}", func(t *testing){

})
# test table snippet
snippet tt
abbr var test = {...}{...} for {t.Run(){...}}
Expand Down

0 comments on commit 5db2f40

Please sign in to comment.