vendor: update all dependencies to latest versions
This commit is contained in:
+8
-16
@@ -24,7 +24,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"cloud.google.com/go/internal/testutil"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"golang.org/x/net/context"
|
||||
pb "google.golang.org/genproto/googleapis/datastore/v1"
|
||||
"google.golang.org/grpc"
|
||||
@@ -1942,18 +1945,7 @@ func TestRoundTrip(t *testing.T) {
|
||||
sortPL(*pl)
|
||||
}
|
||||
|
||||
equal := false
|
||||
switch v := got.(type) {
|
||||
// Round tripping a time.Time can result in a different time.Location: Local instead of UTC.
|
||||
// We therefore test equality explicitly, instead of relying on reflect.DeepEqual.
|
||||
case *T:
|
||||
equal = v.T.Equal(tc.want.(*T).T)
|
||||
case *SpecialTime:
|
||||
equal = v.MyTime.Equal(tc.want.(*SpecialTime).MyTime.Time)
|
||||
default:
|
||||
equal = reflect.DeepEqual(got, tc.want)
|
||||
}
|
||||
if !equal {
|
||||
if !testutil.Equal(got, tc.want, cmp.AllowUnexported(X0{}, X2{})) {
|
||||
t.Errorf("%s: compare:\ngot: %+#v\nwant: %+#v", tc.desc, got, tc.want)
|
||||
continue
|
||||
}
|
||||
@@ -2707,7 +2699,7 @@ func TestLoadSavePLS(t *testing.T) {
|
||||
t.Errorf("%s: save: %v", tc.desc, err)
|
||||
continue
|
||||
}
|
||||
if !reflect.DeepEqual(e, tc.wantSave) {
|
||||
if !testutil.Equal(e, tc.wantSave) {
|
||||
t.Errorf("%s: save: \ngot: %+v\nwant: %+v", tc.desc, e, tc.wantSave)
|
||||
continue
|
||||
}
|
||||
@@ -2729,7 +2721,7 @@ func TestLoadSavePLS(t *testing.T) {
|
||||
t.Errorf("%s: load: %v", tc.desc, err)
|
||||
continue
|
||||
}
|
||||
if !reflect.DeepEqual(gota, tc.wantLoad) {
|
||||
if !testutil.Equal(gota, tc.wantLoad) {
|
||||
t.Errorf("%s: load: \ngot: %+v\nwant: %+v", tc.desc, gota, tc.wantLoad)
|
||||
continue
|
||||
}
|
||||
@@ -2864,7 +2856,7 @@ func TestQueryConstruction(t *testing.T) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
if !reflect.DeepEqual(test.q, test.exp) {
|
||||
if !testutil.Equal(test.q, test.exp, cmp.AllowUnexported(Query{})) {
|
||||
t.Errorf("%d: mismatch: got %v want %v", i, test.q, test.exp)
|
||||
}
|
||||
}
|
||||
@@ -3322,7 +3314,7 @@ func TestKeyLoaderEndToEnd(t *testing.T) {
|
||||
}
|
||||
|
||||
for i := range dst {
|
||||
if !reflect.DeepEqual(dst[i].K, keys[i]) {
|
||||
if !testutil.Equal(dst[i].K, keys[i]) {
|
||||
t.Fatalf("unexpected entity %d to have key %+v, got %+v", i, keys[i], dst[i].K)
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -78,7 +78,7 @@ func TestBasics(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("client.Delete: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(x0, x1) {
|
||||
if !testutil.Equal(x0, x1) {
|
||||
t.Errorf("compare: x0=%v, x1=%v", x0, x1)
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ func TestTopLevelKeyLoaded(t *testing.T) {
|
||||
}
|
||||
|
||||
// The two keys should be absolutely identical.
|
||||
if !reflect.DeepEqual(e.K, k) {
|
||||
if !testutil.Equal(e.K, k) {
|
||||
t.Fatalf("e.K not equal to k; got %#v, want %#v", e.K, k)
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ func TestListValues(t *testing.T) {
|
||||
if err := client.Get(ctx, k, &p1); err != nil {
|
||||
t.Errorf("client.Get: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(p0, p1) {
|
||||
if !testutil.Equal(p0, p1) {
|
||||
t.Errorf("compare:\np0=%v\np1=%#v", p0, p1)
|
||||
}
|
||||
if err = client.Delete(ctx, k); err != nil {
|
||||
@@ -402,7 +402,7 @@ func TestFilters(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("client.GetAll: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
if !testutil.Equal(got, want) {
|
||||
t.Errorf("compare: got=%v, want=%v", got, want)
|
||||
}
|
||||
}, func() {
|
||||
@@ -421,7 +421,7 @@ func TestFilters(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("client.GetAll: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
if !testutil.Equal(got, want) {
|
||||
t.Errorf("compare: got=%v, want=%v", got, want)
|
||||
}
|
||||
})
|
||||
@@ -730,10 +730,10 @@ func TestGetAllWithFieldMismatch(t *testing.T) {
|
||||
{X: 22},
|
||||
}
|
||||
getKeys, err := client.GetAll(ctx, NewQuery("GetAllThing").Ancestor(parent), &got)
|
||||
if len(getKeys) != 3 && !reflect.DeepEqual(getKeys, putKeys) {
|
||||
if len(getKeys) != 3 && !testutil.Equal(getKeys, putKeys) {
|
||||
t.Errorf("client.GetAll: keys differ\ngetKeys=%v\nputKeys=%v", getKeys, putKeys)
|
||||
}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
if !testutil.Equal(got, want) {
|
||||
t.Errorf("client.GetAll: entities differ\ngot =%v\nwant=%v", got, want)
|
||||
}
|
||||
if _, ok := err.(*ErrFieldMismatch); !ok {
|
||||
@@ -858,7 +858,7 @@ loop:
|
||||
got = append(got, dst.I)
|
||||
}
|
||||
sort.Ints(got)
|
||||
if !reflect.DeepEqual(got, tc.want) {
|
||||
if !testutil.Equal(got, tc.want) {
|
||||
t.Errorf("elems %q: got %+v want %+v", tc.desc, got, tc.want)
|
||||
continue
|
||||
}
|
||||
@@ -994,7 +994,7 @@ func TestNilPointers(t *testing.T) {
|
||||
xs := make([]*X, 2)
|
||||
if err := client.GetMulti(ctx, keys, xs); err != nil {
|
||||
t.Errorf("GetMulti: %v", err)
|
||||
} else if !reflect.DeepEqual(xs, src) {
|
||||
} else if !testutil.Equal(xs, src) {
|
||||
t.Errorf("GetMulti fetched %v, want %v", xs, src)
|
||||
}
|
||||
|
||||
|
||||
+6
-4
@@ -18,6 +18,8 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"cloud.google.com/go/internal/testutil"
|
||||
|
||||
pb "google.golang.org/genproto/googleapis/datastore/v1"
|
||||
)
|
||||
|
||||
@@ -164,7 +166,7 @@ func TestLoadEntityNestedLegacy(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(tc.want, dst) {
|
||||
if !testutil.Equal(tc.want, dst) {
|
||||
t.Errorf("%s: compare:\ngot: %#v\nwant: %#v", tc.desc, dst, tc.want)
|
||||
}
|
||||
}
|
||||
@@ -407,7 +409,7 @@ func TestLoadEntityNested(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(tc.want, dst) {
|
||||
if !testutil.Equal(tc.want, dst) {
|
||||
t.Errorf("%s: compare:\ngot: %#v\nwant: %#v", tc.desc, dst, tc.want)
|
||||
}
|
||||
}
|
||||
@@ -503,7 +505,7 @@ func TestAlreadyPopulatedDst(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(tc.want, tc.dst) {
|
||||
if !testutil.Equal(tc.want, tc.dst) {
|
||||
t.Errorf("%s: compare:\ngot: %#v\nwant: %#v", tc.desc, tc.dst, tc.want)
|
||||
}
|
||||
}
|
||||
@@ -748,7 +750,7 @@ func TestKeyLoader(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(tc.want, tc.dst) {
|
||||
if !testutil.Equal(tc.want, tc.dst) {
|
||||
t.Errorf("%s: compare:\ngot: %+v\nwant: %+v", tc.desc, tc.dst, tc.want)
|
||||
}
|
||||
}
|
||||
|
||||
+8
-5
@@ -21,7 +21,10 @@ import (
|
||||
"sort"
|
||||
"testing"
|
||||
|
||||
"cloud.google.com/go/internal/testutil"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"golang.org/x/net/context"
|
||||
pb "google.golang.org/genproto/googleapis/datastore/v1"
|
||||
"google.golang.org/grpc"
|
||||
@@ -334,7 +337,7 @@ func TestSimpleQuery(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(tc.dst, tc.want) {
|
||||
if !testutil.Equal(tc.dst, tc.want) {
|
||||
t.Errorf("dst type %T: Entities\ngot %+v\nwant %+v", tc.dst, tc.dst, tc.want)
|
||||
continue
|
||||
}
|
||||
@@ -357,10 +360,10 @@ func TestQueriesAreImmutable(t *testing.T) {
|
||||
q0 := NewQuery("foo")
|
||||
q1 := NewQuery("foo")
|
||||
q2 := q1.Offset(2)
|
||||
if !reflect.DeepEqual(q0, q1) {
|
||||
if !testutil.Equal(q0, q1, cmp.AllowUnexported(Query{})) {
|
||||
t.Errorf("q0 and q1 were not equal")
|
||||
}
|
||||
if reflect.DeepEqual(q1, q2) {
|
||||
if testutil.Equal(q1, q2, cmp.AllowUnexported(Query{})) {
|
||||
t.Errorf("q1 and q2 were equal")
|
||||
}
|
||||
|
||||
@@ -381,10 +384,10 @@ func TestQueriesAreImmutable(t *testing.T) {
|
||||
q4 := f()
|
||||
q5 := q4.Order("y")
|
||||
q6 := q4.Order("z")
|
||||
if !reflect.DeepEqual(q3, q5) {
|
||||
if !testutil.Equal(q3, q5, cmp.AllowUnexported(Query{})) {
|
||||
t.Errorf("q3 and q5 were not equal")
|
||||
}
|
||||
if reflect.DeepEqual(q5, q6) {
|
||||
if testutil.Equal(q5, q6, cmp.AllowUnexported(Query{})) {
|
||||
t.Errorf("q5 and q6 were equal")
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -15,9 +15,10 @@
|
||||
package datastore
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"cloud.google.com/go/internal/testutil"
|
||||
|
||||
pb "google.golang.org/genproto/googleapis/datastore/v1"
|
||||
)
|
||||
|
||||
@@ -187,7 +188,7 @@ func TestSaveEntityNested(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(tc.want, got) {
|
||||
if !testutil.Equal(tc.want, got) {
|
||||
t.Errorf("%s: compare:\ngot: %#v\nwant: %#v", tc.desc, got, tc.want)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user