mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
chore: add more tests (#2410)
This commit is contained in:
parent
2cde970c9e
commit
0ea92b7280
@ -53,3 +53,16 @@ func TestNewRequestParserWithForm(t *testing.T) {
|
||||
assert.Nil(t, err)
|
||||
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…
Reference in New Issue
Block a user