chore: add more tests (#2410)

master
Kevin Wan 2 years ago committed by GitHub
parent 2cde970c9e
commit 0ea92b7280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -53,3 +53,16 @@ func TestNewRequestParserWithForm(t *testing.T) {
assert.Nil(t, err) assert.Nil(t, err)
assert.NotNil(t, parser) assert.NotNil(t, parser)
} }
func TestNewRequestParserWithBadForm(t *testing.T) {
req := httptest.NewRequest("GET", "/val?a%1=b", nil)
parser, err := NewRequestParser(req, nil)
assert.NotNil(t, err)
assert.Nil(t, parser)
}
func TestRequestParser_buildJsonRequestParser(t *testing.T) {
parser, err := buildJsonRequestParser(map[string]interface{}{"a": make(chan int)}, nil)
assert.NotNil(t, err)
assert.Nil(t, parser)
}

Loading…
Cancel
Save