mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-21 16:58:08 +08:00
Add unit test for SetServer
This commit is contained in:
parent
085c04a2a3
commit
5f1e881e3e
@ -176,6 +176,14 @@ func TestCreateEngine(t *testing.T) {
|
|||||||
assert.Empty(t, router.Handlers)
|
assert.Empty(t, router.Handlers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSetServer(t *testing.T) {
|
||||||
|
router := New()
|
||||||
|
router.SetServer(&http.Server{IdleTimeout: 5 * time.Second})
|
||||||
|
assert.Equal(t, "/", router.basePath)
|
||||||
|
assert.Equal(t, router.engine, router)
|
||||||
|
assert.Empty(t, router.Handlers)
|
||||||
|
}
|
||||||
|
|
||||||
func TestLoadHTMLFilesTestMode(t *testing.T) {
|
func TestLoadHTMLFilesTestMode(t *testing.T) {
|
||||||
ts := setupHTMLFiles(
|
ts := setupHTMLFiles(
|
||||||
t,
|
t,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user