1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 18:30:50 +00:00

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

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")
}
})
}