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: filter/dscache/dscache_test.go

Issue 1355783002: Refactor keys and queries in datastore service and implementation. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: appease errcheck Created 5 years, 3 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 | « filter/dscache/dscache.go ('k') | filter/dscache/globalconfig.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/dscache/dscache_test.go
diff --git a/filter/dscache/dscache_test.go b/filter/dscache/dscache_test.go
index 6b0240d04f4f2f90c5785e9b586c83d9d85f9fba..5cdad302e3d131f00ff9bfdb408550abc727bac8 100644
--- a/filter/dscache/dscache_test.go
+++ b/filter/dscache/dscache_test.go
@@ -66,15 +66,16 @@ func TestDSCache(t *testing.T) {
dsUnder := datastore.Get(c)
mc := memcache.Get(c)
- itmFor := func(i int, k datastore.Key) memcache.Item {
+ itmFor := func(i int, k *datastore.Key) memcache.Item {
return mc.NewItem(MakeMemcacheKey(i, k))
}
- shardsForKey := func(k datastore.Key) int {
- if k.Kind() == "shardObj" {
- return int(k.IntID())
+ shardsForKey := func(k *datastore.Key) int {
+ last := k.Last()
+ if last.Kind == "shardObj" {
+ return int(last.IntID)
}
- if k.Kind() == "noCacheObj" {
+ if last.Kind == "noCacheObj" {
return 0
}
return DefaultShards
« no previous file with comments | « filter/dscache/dscache.go ('k') | filter/dscache/globalconfig.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698