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

Side by Side Diff: impl/memory/datastore_query_test.go

Issue 1336443003: Implement projection queries correctly. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fix comments 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package memory 5 package memory
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "math" 9 "math"
10 "testing" 10 "testing"
(...skipping 24 matching lines...) Expand all
35 // normally you can only get cursors from inside of the memory 35 // normally you can only get cursors from inside of the memory
36 // implementation, so this construction is just for test ing. 36 // implementation, so this construction is just for test ing.
37 start := queryCursor(bjoin( 37 start := queryCursor(bjoin(
38 mkNum(2), 38 mkNum(2),
39 serialize.ToBytes(dsS.IndexColumn{Property: "far nsworth"}), 39 serialize.ToBytes(dsS.IndexColumn{Property: "far nsworth"}),
40 serialize.ToBytes(dsS.IndexColumn{Property: "__k ey__"}), 40 serialize.ToBytes(dsS.IndexColumn{Property: "__k ey__"}),
41 serialize.ToBytes(prop(200)), 41 serialize.ToBytes(prop(200)),
42 serialize.ToBytes(prop(ds.NewKey("Foo", "id", 0, nil))))) 42 serialize.ToBytes(prop(ds.NewKey("Foo", "id", 0, nil)))))
43 43
44 So(start.String(), ShouldEqual, 44 So(start.String(), ShouldEqual,
45 » » » » `gYAAZzFdTeeb3d9zOxsAAF-v221Xy32_AIGHyIkAAUc32-A GabMAAA==`) 45 » » » » `gYAAZzFdTeeb3d9zOxsAAF-v221Xy32_AIGHyIgAAUc32-A FabMAAA==`)
46 46
47 end := queryCursor(bjoin( 47 end := queryCursor(bjoin(
48 mkNum(2), 48 mkNum(2),
49 serialize.ToBytes(dsS.IndexColumn{Property: "far nsworth"}), 49 serialize.ToBytes(dsS.IndexColumn{Property: "far nsworth"}),
50 serialize.ToBytes(dsS.IndexColumn{Property: "__k ey__"}), 50 serialize.ToBytes(dsS.IndexColumn{Property: "__k ey__"}),
51 serialize.ToBytes(prop(3000)), 51 serialize.ToBytes(prop(3000)),
52 serialize.ToBytes(prop(ds.NewKey("Foo", "zeta", 0, nil))))) 52 serialize.ToBytes(prop(ds.NewKey("Foo", "zeta", 0, nil)))))
53 53
54 q = q.Start(start).End(end) 54 q = q.Start(start).End(end)
55 So(q, ShouldNotBeNil) 55 So(q, ShouldNotBeNil)
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 q := nq().Ancestor(key("thing", "wat")) 405 q := nq().Ancestor(key("thing", "wat"))
406 for i := 0; i < 100; i++ { 406 for i := 0; i < 100; i++ {
407 q = q.Filter("something =", i) 407 q = q.Filter("something =", i)
408 } 408 }
409 //So(q.(*queryImpl).numComponents(), ShouldEqual, 101) 409 //So(q.(*queryImpl).numComponents(), ShouldEqual, 101)
410 _, err := q.(*queryImpl).reduce("ns", false) 410 _, err := q.(*queryImpl).reduce("ns", false)
411 So(err, ShouldErrLike, "query is too large") 411 So(err, ShouldErrLike, "query is too large")
412 }) 412 })
413 }) 413 })
414 } 414 }
OLDNEW
« no previous file with comments | « impl/memory/datastore_query_execution_test.go ('k') | impl/prod/raw_datastore_type_converter.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698