Add bench test on context input query

This commit is contained in:
playHing 2020-07-11 02:00:48 +08:00
parent 1c0714405a
commit b50fb44950
1 changed files with 10 additions and 0 deletions

View File

@ -205,3 +205,13 @@ func TestParams(t *testing.T) {
}
}
func BenchmarkQuery(b *testing.B) {
beegoInput := NewInput()
beegoInput.Context = NewContext()
beegoInput.Context.Request, _ = http.NewRequest("POST", "http://www.example.com/?q=foo", nil)
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
beegoInput.Query("q")
}
})
}