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

Unified Diff: impl/memory/testing_utils_test.go

Issue 1285703002: Add testable interface for datastore. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fixes after Raw change 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/taskqueue_test.go ('k') | impl/prod/raw_datastore.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/testing_utils_test.go
diff --git a/impl/memory/testing_utils_test.go b/impl/memory/testing_utils_test.go
index f8aa745db82d51b3513068b5614e193ee7d5d55e..85a75ecc0cf3f4aafd30bff2b0e13fe2836e3f02 100644
--- a/impl/memory/testing_utils_test.go
+++ b/impl/memory/testing_utils_test.go
@@ -15,20 +15,20 @@ import (
type kv struct{ k, v []byte }
-func indx(kind string, orders ...string) *qIndex {
+func indx(kind string, orders ...string) *ds.IndexDefinition {
ancestor := false
if kind[len(kind)-1] == '!' {
ancestor = true
kind = kind[:len(kind)-1]
}
- ret := &qIndex{kind, ancestor, nil}
+ ret := &ds.IndexDefinition{Kind: kind, Ancestor: ancestor}
for _, o := range orders {
- dir := qASC
+ dir := ds.ASCENDING
if o[0] == '-' {
- dir = qDEC
+ dir = ds.DESCENDING
o = o[1:]
}
- ret.sortby = append(ret.sortby, qSortBy{o, dir})
+ ret.SortBy = append(ret.SortBy, ds.IndexColumn{Property: o, Direction: dir})
}
return ret
}
@@ -81,8 +81,8 @@ func cat(bytethings ...interface{}) []byte {
ds.WriteTime(buf, x)
case ds.Key:
ds.WriteKey(buf, ds.WithoutContext, x)
- case *qIndex:
- x.WriteBinary(buf)
+ case *ds.IndexDefinition:
+ x.Write(buf)
default:
panic(fmt.Errorf("I don't know how to deal with %T: %#v", thing, thing))
}
« no previous file with comments | « impl/memory/taskqueue_test.go ('k') | impl/prod/raw_datastore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698