Fix tests (#201)

Co-authored-by: RPRX <63339210+rprx@users.noreply.github.com>
This commit is contained in:
Jim Han 2021-01-30 21:01:20 +08:00 committed by GitHub
parent d032a8deb7
commit 4cd343f2d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 18 deletions

View file

@ -45,7 +45,7 @@ func TestUDPEncoding(t *testing.T) {
t.Error("data: ", r)
}
if r := cmp.Diff(decodedRequest, request); r != "" {
if r := cmp.Diff(decodedRequest, request, cmp.Comparer(func(a1, a2 protocol.Account) bool { return a1.Equals(a2) })); r != "" {
t.Error("request: ", r)
}
}
@ -119,7 +119,7 @@ func TestTCPRequest(t *testing.T) {
decodedRequest, reader, err := ReadTCPSession([]*protocol.MemoryUser{request.User}, cache)
common.Must(err)
if r := cmp.Diff(decodedRequest, request); r != "" {
if r := cmp.Diff(decodedRequest, request, cmp.Comparer(func(a1, a2 protocol.Account) bool { return a1.Equals(a2) })); r != "" {
t.Error("request: ", r)
}