mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 09:20:55 +00:00
Add bench test on context input query
This commit is contained in:
parent
1c0714405a
commit
b50fb44950
@ -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")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user