Skip to content

Commit

Permalink
add benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
haya14busa committed Sep 14, 2016
1 parent 91d84c9 commit 36af432
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion go/vimlparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"testing"
)

func recovert(t *testing.T) {
func recovert(t testing.TB) {
if r := recover(); r != nil {
t.Errorf("Recovered: %v\n%s", r, debug.Stack())
}
Expand Down Expand Up @@ -174,6 +174,16 @@ func readlines(path string) ([]string, error) {
}

func TestVimLParser_VimLParser(t *testing.T) {
testParseVimLParser(t)
}

func BenchmarkVimLParser_VimLParser(b *testing.B) {
for i := 0; i < b.N; i++ {
testParseVimLParser(b)
}
}

func testParseVimLParser(t testing.TB) {
defer recovert(t)
p, err := build.Default.Import(basePkg, "", build.FindOnly)
if err != nil {
Expand Down

0 comments on commit 36af432

Please sign in to comment.