Skip to content

Commit

Permalink
update build tag
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkerou committed Feb 22, 2023
1 parent 9a89fb6 commit 5802886
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 33 deletions.
4 changes: 2 additions & 2 deletions context_1.18_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.

//go:build go1.18
// +build go1.18
//go:build !go1.19
// +build !go1.19

package gin

Expand Down
31 changes: 0 additions & 31 deletions context_1.19_test.go

This file was deleted.

13 changes: 13 additions & 0 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ func TestContextFormFile(t *testing.T) {
assert.NoError(t, c.SaveUploadedFile(f, "test"))
}

func TestContextFormFileFailed19(t *testing.T) {
buf := new(bytes.Buffer)
mw := multipart.NewWriter(buf)
mw.Close()
c, _ := CreateTestContext(httptest.NewRecorder())
c.Request, _ = http.NewRequest("POST", "/", nil)
c.Request.Header.Set("Content-Type", mw.FormDataContentType())
c.engine.MaxMultipartMemory = 8 << 20
f, err := c.FormFile("file")
assert.Error(t, err)
assert.Nil(t, f)
}

func TestContextMultipartForm(t *testing.T) {
buf := new(bytes.Buffer)
mw := multipart.NewWriter(buf)
Expand Down

0 comments on commit 5802886

Please sign in to comment.