| 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 "sort" | 8 "sort" |
| 9 "testing" | 9 "testing" |
| 10 "time" | 10 "time" |
| 11 | 11 |
| 12 ds "github.com/luci/gae/service/datastore" | 12 ds "github.com/luci/gae/service/datastore" |
| 13 "github.com/luci/gae/service/datastore/serialize" | 13 "github.com/luci/gae/service/datastore/serialize" |
| 14 "github.com/luci/gkvlite" | 14 "github.com/luci/gkvlite" |
| 15 . "github.com/smartystreets/goconvey/convey" | 15 . "github.com/smartystreets/goconvey/convey" |
| 16 ) | 16 ) |
| 17 | 17 |
| 18 var fakeKey = key("parentKind", "sid", "knd", 10) | 18 var fakeKey = key("parentKind", "sid", "knd", 10) |
| 19 | 19 |
| 20 var rgenComplexTime = time.Date( | 20 var rgenComplexTime = time.Date( |
| 21 1986, time.October, 26, 1, 20, 00, 00, time.UTC) | 21 1986, time.October, 26, 1, 20, 00, 00, time.UTC) |
| 22 var rgenComplexKey = key("kind", "id") | 22 var rgenComplexKey = key("kind", "id") |
| 23 var rgenComplexTimeIdx = prop(rgenComplexTime).ForIndex() | 23 |
| 24 var _, rgenComplexTimeInt = prop(rgenComplexTime).IndexTypeAndValue() |
| 25 var rgenComplexTimeIdx = prop(rgenComplexTimeInt) |
| 24 | 26 |
| 25 var rowGenTestCases = []struct { | 27 var rowGenTestCases = []struct { |
| 26 name string | 28 name string |
| 27 pmap ds.PropertyMap | 29 pmap ds.PropertyMap |
| 28 withBuiltin bool | 30 withBuiltin bool |
| 29 idxs []*ds.IndexDefinition | 31 idxs []*ds.IndexDefinition |
| 30 | 32 |
| 31 // These are checked in TestIndexRowGen. nil to skip test case. | 33 // These are checked in TestIndexRowGen. nil to skip test case. |
| 32 expected []serialize.SerializedPslice | 34 expected []serialize.SerializedPslice |
| 33 | 35 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 So(data[i], ShouldResemble, itm.
Key) | 376 So(data[i], ShouldResemble, itm.
Key) |
| 375 i++ | 377 i++ |
| 376 return true | 378 return true |
| 377 }) | 379 }) |
| 378 So(i, ShouldEqual, len(data)) | 380 So(i, ShouldEqual, len(data)) |
| 379 } | 381 } |
| 380 }) | 382 }) |
| 381 } | 383 } |
| 382 }) | 384 }) |
| 383 } | 385 } |
| OLD | NEW |