From: qydysky Date: Thu, 25 May 2023 17:48:16 +0000 (+0800) Subject: add X-Git-Tag: v0.27.13~1 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=cf520255d132fc33b217b658919bf584d1bf5f68;p=part%2F.git add --- diff --git a/web/Web_test.go b/web/Web_test.go index a42b464..a3d4bb3 100644 --- a/web/Web_test.go +++ b/web/Web_test.go @@ -87,9 +87,10 @@ func Test_ServerSyncMapP(t *testing.T) { A string `json:"path"` } - NewSyncMap(&http.Server{ + o := NewSyncMap(&http.Server{ Addr: "127.0.0.1:9090", }, &m) + defer o.Shutdown() m.Store("/1/2", func(w http.ResponseWriter, _ *http.Request) { ResStruct{0, "ok", d{"/1/2"}}.Write(w) }) @@ -102,6 +103,7 @@ func Test_ServerSyncMapP(t *testing.T) { m.Store("/", func(w http.ResponseWriter, _ *http.Request) { ResStruct{0, "ok", d{"/"}}.Write(w) }) + time.Sleep(time.Second) r := reqf.New() res := ResStruct{}