fix unit test cases of ghttp

This commit is contained in:
John
2019-02-01 11:53:10 +08:00
parent 020b050fb1
commit 92c0bf9cdc
2 changed files with 2 additions and 2 deletions

View File

@ -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`)

View File

@ -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(),