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

Unified Diff: impl/memory/datastore_query_execution_test.go

Issue 2498463003: Fix a bug where deletions weren't updating the raw Kind index. (Closed)
Patch Set: Comments, review. Created 4 years, 1 month 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_index.go ('k') | impl/memory/gkvlite_utils.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/datastore_query_execution_test.go
diff --git a/impl/memory/datastore_query_execution_test.go b/impl/memory/datastore_query_execution_test.go
index 0c9399632299ab524033dcdc94b1e620ce675b45..7e8af383a47a048c8a4da2c62f9e8594efe32b11 100644
--- a/impl/memory/datastore_query_execution_test.go
+++ b/impl/memory/datastore_query_execution_test.go
@@ -366,6 +366,12 @@ var queryExecutionTests = []qExTest{
{q: nq("__namespace__").Offset(1).Limit(1), get: []ds.PropertyMap{
pmap("$key", mkKey("dev~app", "", "__namespace__", "bob")),
}},
+ //
+ // eventual consistency; Unique/1 is deleted at HEAD. Keysonly finds it,
+ // but 'normal' doesn't.
+ {q: nq("Unique").Gt("__key__", key("AKind", 5)).Lte("__key__", key("Zeta", "prime")),
+ keys: []*ds.Key{key("Unique", 1)},
+ get: []ds.PropertyMap{}},
},
extraFns: []func(context.Context){
@@ -421,18 +427,13 @@ var queryExecutionTests = []qExTest{
{
expect: []qExpect{
- // eventual consistency; Unique/1 is deleted at HEAD. Keysonly finds it,
- // but 'normal' doesn't.
- {q: nq("Unique").Gt("__key__", key("AKind", 5)).Lte("__key__", key("Zeta", "prime")),
- keys: []*ds.Key{key("Unique", 1)},
- get: []ds.PropertyMap{}},
-
{q: nq("Kind").Eq("Val", 1, 3), get: []ds.PropertyMap{
stage1Data[0], stage2Data[2],
}},
},
},
}},
+
{"collapsed types", []qExStage{
{
putEnts: collapsedData,
@@ -483,6 +484,33 @@ var queryExecutionTests = []qExTest{
},
},
}},
+
+ {"regression: tombstones and limit/offset queries", []qExStage{
+ {
+ putEnts: []ds.PropertyMap{
+ pmap("$key", key("Kind", 1)),
+ pmap("$key", key("Kind", 2)),
+ pmap("$key", key("Kind", 3)),
+ },
+ delEnts: []*ds.Key{key("Kind", 2)},
+ },
+ {
+ expect: []qExpect{
+ {
+ q: nq("Kind").Limit(2),
+ get: []ds.PropertyMap{
+ pmap("$key", key("Kind", 1)),
+ pmap("$key", key("Kind", 3)),
+ },
+ },
+
+ {
+ q: nq("Kind").Offset(2),
+ get: []ds.PropertyMap{},
+ },
+ },
+ },
+ }},
}
func TestQueryExecution(t *testing.T) {
« no previous file with comments | « impl/memory/datastore_index.go ('k') | impl/memory/gkvlite_utils.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698