chore: fix test fail (#1669)

* chore: fix test fail

* fix binduri test fail
This commit is contained in:
thinkerou 2018-12-05 05:58:35 +08:00 committed by GitHub
parent 54e9610400
commit f463d847c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -687,7 +687,7 @@ func TestUriBinding(t *testing.T) {
} }
var not NotSupportStruct var not NotSupportStruct
assert.Error(t, b.BindUri(m, &not)) assert.Error(t, b.BindUri(m, &not))
assert.Equal(t, "", not.Name) assert.Equal(t, map[string]interface{}(nil), not.Name)
} }
func testFormBinding(t *testing.T, method, path, badPath, body, badBody string) { func testFormBinding(t *testing.T, method, path, badPath, body, badBody string) {

View File

@ -11,6 +11,7 @@ import (
"net" "net"
"net/http" "net/http"
"os" "os"
"strings"
"syscall" "syscall"
"testing" "testing"
@ -84,7 +85,7 @@ func TestPanicWithBrokenPipe(t *testing.T) {
const expectCode = 204 const expectCode = 204
expectMsgs := map[syscall.Errno]string{ expectMsgs := map[syscall.Errno]string{
syscall.EPIPE: "Broken pipe", syscall.EPIPE: "broken pipe",
syscall.ECONNRESET: "connection reset by peer", syscall.ECONNRESET: "connection reset by peer",
} }
@ -108,7 +109,7 @@ func TestPanicWithBrokenPipe(t *testing.T) {
w := performRequest(router, "GET", "/recovery") w := performRequest(router, "GET", "/recovery")
// TEST // TEST
assert.Equal(t, expectCode, w.Code) assert.Equal(t, expectCode, w.Code)
assert.Contains(t, buf.String(), expectMsg) assert.Contains(t, strings.ToLower(buf.String()), expectMsg)
}) })
} }
} }