Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1126)

Unified Diff: service/datastore/datastore_test.go

Issue 1816413002: Make ExistsMulti return a BoolList (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « service/datastore/datastore.go ('k') | service/datastore/interface.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/datastore_test.go
diff --git a/service/datastore/datastore_test.go b/service/datastore/datastore_test.go
index 665e3558d929a9effc665fa6b79190b11fa93c2b..c745b675786f75c1d1cb371dcc5804cc74dc1c4b 100644
--- a/service/datastore/datastore_test.go
+++ b/service/datastore/datastore_test.go
@@ -328,10 +328,28 @@ func TestKeyForObj(t *testing.T) {
So(err, ShouldBeNil)
So(e, ShouldBeTrue)
+ bl, err := ds.ExistsMulti([]*Key{k, ds.MakeKey("hello", "other")})
+ So(err, ShouldBeNil)
+ So(bl, ShouldResemble, BoolList{true, true})
+ So(bl.All(), ShouldBeTrue)
+ So(bl.Any(), ShouldBeTrue)
+
+ bl, err = ds.ExistsMulti([]*Key{k, ds.MakeKey("DNE", "other")})
+ So(err, ShouldBeNil)
+ So(bl, ShouldResemble, BoolList{true, false})
+ So(bl.All(), ShouldBeFalse)
+ So(bl.Any(), ShouldBeTrue)
+
e, err = ds.Exists(ds.MakeKey("DNE", "nope"))
So(err, ShouldBeNil)
So(e, ShouldBeFalse)
+ bl, err = ds.ExistsMulti([]*Key{ds.MakeKey("DNE", "nope"), ds.MakeKey("DNE", "other")})
+ So(err, ShouldBeNil)
+ So(bl, ShouldResemble, BoolList{false, false})
+ So(bl.All(), ShouldBeFalse)
+ So(bl.Any(), ShouldBeFalse)
+
_, err = ds.Exists(ds.MakeKey("Fail", "boom"))
So(err, ShouldErrLike, "GetMulti fail")
})
« no previous file with comments | « service/datastore/datastore.go ('k') | service/datastore/interface.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698