Skip to content

Commit

Permalink
fix: test error (gin-gonic#3087)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkerou authored Mar 18, 2022
1 parent 417b142 commit fcd36c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,16 @@ func TestRouteStaticFileFS(t *testing.T) {
router.Static("/using_static", dir)
router.StaticFileFS("/result_fs", filename, Dir(dir, false))

w := performRequest(router, http.MethodGet, "/using_static/"+filename)
w2 := performRequest(router, http.MethodGet, "/result_fs")
w := PerformRequest(router, http.MethodGet, "/using_static/"+filename)
w2 := PerformRequest(router, http.MethodGet, "/result_fs")

assert.Equal(t, w, w2)
assert.Equal(t, http.StatusOK, w.Code)
assert.Equal(t, "Gin Web Framework", w.Body.String())
assert.Equal(t, "text/plain; charset=utf-8", w.Header().Get("Content-Type"))

w3 := performRequest(router, http.MethodHead, "/using_static/"+filename)
w4 := performRequest(router, http.MethodHead, "/result_fs")
w3 := PerformRequest(router, http.MethodHead, "/using_static/"+filename)
w4 := PerformRequest(router, http.MethodHead, "/result_fs")

assert.Equal(t, w3, w4)
assert.Equal(t, http.StatusOK, w3.Code)
Expand Down

0 comments on commit fcd36c5

Please sign in to comment.