fix issue in unit testing case for package ghttp

This commit is contained in:
john
2020-06-13 14:52:36 +08:00
parent 49d1e3dbaf
commit 1d609fc5c7

View File

@ -183,8 +183,8 @@ func Test_Params_Struct(t *testing.T) {
t.Assert(client.PostContent("/struct1", `id=1&name=john&password1=123&password2=456`), `1john123456`)
t.Assert(client.PostContent("/struct2", `id=1&name=john&password1=123&password2=456`), `1john123456`)
t.Assert(client.PostContent("/struct2", ``), ``)
t.Assert(client.PostContent("/struct-valid", `id=1&name=john&password1=123&password2=0`), `The value length must be between 2 and 20; 密码强度不足`)
t.Assert(client.PostContent("/parse", `id=1&name=john&password1=123&password2=0`), `The value length must be between 2 and 20; 密码强度不足`)
t.Assert(client.PostContent("/struct-valid", `id=1&name=john&password1=123&password2=0`), `The passwd1 value length must be between 2 and 20; 密码强度不足`)
t.Assert(client.PostContent("/parse", `id=1&name=john&password1=123&password2=0`), `The passwd1 value length must be between 2 and 20; 密码强度不足`)
t.Assert(client.GetContent("/parse", `id=1&name=john&password1=123&password2=456`), `密码强度不足`)
t.Assert(client.GetContent("/parse", `id=1&name=john&password1=123Abc!@#&password2=123Abc!@#`), `1john123Abc!@#123Abc!@#`)
t.Assert(client.PostContent("/parse", `{"id":1,"name":"john","password1":"123Abc!@#","password2":"123Abc!@#"}`), `1john123Abc!@#123Abc!@#`)