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) { |