mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
fix unit test cases of ghttp
This commit is contained in:
@ -128,7 +128,7 @@ func Test_Params(t *testing.T) {
|
||||
gtest.Assert(client.PostContent("/post", "float64=0.22"), `0.22`)
|
||||
gtest.Assert(client.PostContent("/post", "int=-10000"), `-10000`)
|
||||
gtest.Assert(client.PostContent("/post", "int=10000"), `10000`)
|
||||
gtest.Assert(client.PostContent("/post", "uint=-10000"), `10000`)
|
||||
gtest.Assert(client.PostContent("/post", "uint=10000"), `10000`)
|
||||
gtest.Assert(client.PostContent("/post", "uint=9"), `9`)
|
||||
gtest.Assert(client.PostContent("/post", "string=key"), `key`)
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@ func compareMap(value, expect interface{}) error {
|
||||
if rvExpect.Len() == rvValue.Len() {
|
||||
ksExpect := rvExpect.MapKeys()
|
||||
for _, key := range ksExpect {
|
||||
if fmt.Sprintf("%v", rvValue.MapIndex(key).Interface()) != rvExpect.MapIndex(key).Interface() {
|
||||
if fmt.Sprintf("%v", rvValue.MapIndex(key).Interface()) != fmt.Sprintf("%v", rvExpect.MapIndex(key).Interface()) {
|
||||
return fmt.Errorf(`[ASSERT] EXPECT VALUE map["%v"]:%v == %v`,
|
||||
key,
|
||||
rvValue.MapIndex(key).Interface(),
|
||||
|
||||
Reference in New Issue
Block a user