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

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

Issue 1550903002: impl/memory: Fix time serialization encoding. (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: Comments, tune-up. Created 4 years, 11 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
« no previous file with comments | « no previous file | impl/memory/datastore_query.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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 }
OLDNEW
« no previous file with comments | « no previous file | impl/memory/datastore_query.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698