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

Unified Diff: impl/memory/datastore_test.go

Issue 1302813003: impl/memory: Implement Queries (Closed) Base URL: https://github.com/luci/gae.git@add_multi_iterator
Patch Set: stringSet everywhere Created 5 years, 4 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 | « impl/memory/datastore_query_test.go ('k') | impl/memory/doc.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/datastore_test.go
diff --git a/impl/memory/datastore_test.go b/impl/memory/datastore_test.go
index 8f6a932b2b60b6ffb0dcf302e92e2afa5ad0ded5..4cfffbd47b97c04341501b6d7980fe02cb86fb2f 100644
--- a/impl/memory/datastore_test.go
+++ b/impl/memory/datastore_test.go
@@ -139,7 +139,7 @@ func TestDatastoreSingleReadWriter(t *testing.T) {
// TODO(riannucci): replace with a Count query instead of this cast
/*
- ents := ds.(*dsImpl).data.store.GetCollection("ents:")
+ ents := ds.(*dsImpl).data.head.GetCollection("ents:")
num, _ := ents.GetTotals()
// /__entity_root_ids__,Foo
// /Foo,1/__entity_group__,1
@@ -428,7 +428,7 @@ func TestCompoundIndexes(t *testing.T) {
idxKey := func(def dsS.IndexDefinition) string {
So(def, ShouldNotBeNil)
- return "idx::" + string(serialize.ToBytes(def))
+ return "idx::" + string(serialize.ToBytes(*def.PrepForIdxTable()))
}
numItms := func(c *memCollection) uint64 {
@@ -447,7 +447,7 @@ func TestCompoundIndexes(t *testing.T) {
c := Use(context.Background())
ds := dsS.Get(c)
t := ds.Raw().Testable().(*dsImpl)
- store := t.data.store
+ head := t.data.head
So(ds.Put(&Model{1, []string{"hello", "world"}, []int64{10, 11}}), ShouldBeNil)
@@ -458,20 +458,20 @@ func TestCompoundIndexes(t *testing.T) {
},
}
- coll := store.GetCollection(idxKey(idx))
+ coll := head.GetCollection(idxKey(idx))
So(coll, ShouldNotBeNil)
So(numItms(coll), ShouldEqual, 2)
idx.SortBy[0].Property = "Field1"
- coll = store.GetCollection(idxKey(idx))
+ coll = head.GetCollection(idxKey(idx))
So(coll, ShouldNotBeNil)
So(numItms(coll), ShouldEqual, 2)
idx.SortBy = append(idx.SortBy, dsS.IndexColumn{Property: "Field1"})
- So(store.GetCollection(idxKey(idx)), ShouldBeNil)
+ So(head.GetCollection(idxKey(idx)), ShouldBeNil)
t.AddIndexes(&idx)
- coll = store.GetCollection(idxKey(idx))
+ coll = head.GetCollection(idxKey(idx))
So(coll, ShouldNotBeNil)
So(numItms(coll), ShouldEqual, 4)
})
« no previous file with comments | « impl/memory/datastore_query_test.go ('k') | impl/memory/doc.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698