👍 improve router test coverage

pull/608/head
kiyon 2020-07-15 10:37:25 +08:00
parent 5c502ed21c
commit 75be864c12
1 changed files with 15 additions and 0 deletions

View File

@ -214,6 +214,21 @@ func Test_Ensure_Router_Interface_Implementation(t *testing.T) {
utils.AssertEqual(t, true, ok)
}
func Test_Router_Handler_SetETag(t *testing.T) {
app := New()
app.Settings.ETag = true
app.Get("/", func(c *Ctx) {
c.Send("Hello, World!")
})
c := &fasthttp.RequestCtx{}
app.handler(c)
utils.AssertEqual(t, `"13-1831710635"`, string(c.Response.Header.Peek(HeaderETag)))
}
//////////////////////////////////////////////
///////////////// BENCHMARKS /////////////////
//////////////////////////////////////////////