OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |