wal: Fix format error avoid using reflect.DeepEqual with errors (#12118)

release-3.5
kaiiak 2020-07-21 10:49:57 +08:00 committed by GitHub
parent e9d16c2b62
commit 772dfbfe35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ package wal
import ( import (
"bytes" "bytes"
"errors"
"hash/crc32" "hash/crc32"
"io" "io"
"io/ioutil" "io/ioutil"
@ -57,7 +58,7 @@ func TestReadRecord(t *testing.T) {
if !reflect.DeepEqual(rec, tt.wr) { if !reflect.DeepEqual(rec, tt.wr) {
t.Errorf("#%d: block = %v, want %v", i, rec, tt.wr) t.Errorf("#%d: block = %v, want %v", i, rec, tt.wr)
} }
if !reflect.DeepEqual(e, tt.we) { if !errors.Is(e, tt.we) {
t.Errorf("#%d: err = %v, want %v", i, e, tt.we) t.Errorf("#%d: err = %v, want %v", i, e, tt.we)
} }
rec = &walpb.Record{} rec = &walpb.Record{}