Skip to content

Commit

Permalink
fix: unit test fail in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyenought committed Nov 25, 2023
1 parent 9c3f0b7 commit f75f3b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/route/routergroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ func TestRouterGroupStatic(t *testing.T) {
func TestRouterGroupStaticFile(t *testing.T) {
router := NewEngine(config.NewOptions(nil))
router.StaticFile("file", "./engine.go")
w := performRequest(router, "GET", "/file")
w := performRequest(router, "GET", "/file", header{
Key: "Host",
Value: "127.0.0.1",
})
assert.DeepEqual(t, http.StatusOK, w.Code)
fd, err := os.Open("./engine.go")
if err != nil {
Expand Down
5 changes: 4 additions & 1 deletion pkg/route/routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,10 @@ func TestRouteStaticFile(t *testing.T) {
router.StaticFile("/result", f.Name())

w := performRequest(router, consts.MethodGet, "/using_static/"+filename)
w2 := performRequest(router, consts.MethodGet, "/result")
w2 := performRequest(router, consts.MethodGet, "/result", header{
Key: "Host",
Value: "127.0.0.1",
})

assert.DeepEqual(t, w, w2)
assert.DeepEqual(t, consts.StatusOK, w.Code)
Expand Down

0 comments on commit f75f3b0

Please sign in to comment.