Skip to content

Commit

Permalink
Merge pull request #198 from itchyny/go-funcfuzz
Browse files Browse the repository at this point in the history
go: Add funcfuzz snippet
  • Loading branch information
Shougo authored Apr 1, 2022
2 parents 8a6655a + 3c6e1c6 commit 725c989
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions neosnippets/go.snip
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,31 @@ options head
case ${1:#:condition}:
${2:TARGET}

snippet funcTest
abbr func Test... (t *testing.T) { ... }
snippet functest
abbr func Test...(t *testing.T) { ... }
options head
func Test${1} (${2:t *testing.T}) {
for i := 0; i < ${3:t.N}; i++ {
${4}
}
func Test${1}(${2:t *testing.T}) {
${3}
}

snippet funcbench
abbr func Benchmark... (b *testing.B) { ... }
abbr func Benchmark...(b *testing.B) { ... }
options head
func Benchmark${1} (${2:b *testing.B}) {
func Benchmark${1}(${2:b *testing.B}) {
for i := 0; i < ${3:b.N}; i++ {
${4}
}
}

snippet funcfuzz
abbr func Fuzz...(f *testing.F) { ... }
options head
func Fuzz${1}(${2:f *testing.F}) {
f.Fuzz(func(t *testing.T, ${3:b []byte}) {
${4}
})
}

snippet testtable
abbr var test = {...}{...} for {t.Run(){...}}
options head
Expand Down

0 comments on commit 725c989

Please sign in to comment.