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

Side by Side Diff: service/datastore/size_test.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Lightning talk licenses. Created 4 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
« no previous file with comments | « service/datastore/serialize/serialize_test.go ('k') | service/datastore/transaction.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 LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package datastore 5 package datastore
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "sort" 10 "sort"
(...skipping 14 matching lines...) Expand all
25 25
26 var estimateSizeTests = []struct { 26 var estimateSizeTests = []struct {
27 pm PropertyMap 27 pm PropertyMap
28 expect int 28 expect int
29 }{ 29 }{
30 {PropertyMap{"Something": mps()}, 9}, 30 {PropertyMap{"Something": mps()}, 9},
31 {PropertyMap{"Something": mps(100)}, 18}, 31 {PropertyMap{"Something": mps(100)}, 18},
32 {PropertyMap{"Something": mps(100.1, "sup")}, 22}, 32 {PropertyMap{"Something": mps(100.1, "sup")}, 22},
33 {PropertyMap{ 33 {PropertyMap{
34 "Something": mps(100, "sup"), 34 "Something": mps(100, "sup"),
35 » » "Keys": mps(MakeKey("aid", "ns", "parent", "something", "ki nd", int64(20))), 35 » » "Keys": mps(KeyContext{"aid", "ns"}.MakeKey("parent", "some thing", "kind", int64(20))),
36 }, 59}, 36 }, 59},
37 {PropertyMap{ 37 {PropertyMap{
38 "Null": mps(nil), 38 "Null": mps(nil),
39 "Bool": mps(true, false), 39 "Bool": mps(true, false),
40 "GP": mps(GeoPoint{23.2, 122.1}), 40 "GP": mps(GeoPoint{23.2, 122.1}),
41 "bskey": mps(blobstore.Key("hello")), 41 "bskey": mps(blobstore.Key("hello")),
42 "[]byte": mps([]byte("sup")), 42 "[]byte": mps([]byte("sup")),
43 }, 59}, 43 }, 59},
44 } 44 }
45 45
(...skipping 25 matching lines...) Expand all
71 t.Parallel() 71 t.Parallel()
72 72
73 Convey("Test EstimateSize", t, func() { 73 Convey("Test EstimateSize", t, func() {
74 for _, tc := range estimateSizeTests { 74 for _, tc := range estimateSizeTests {
75 Convey(stablePmString(tc.pm), func() { 75 Convey(stablePmString(tc.pm), func() {
76 So(tc.pm.EstimateSize(), ShouldEqual, tc.expect) 76 So(tc.pm.EstimateSize(), ShouldEqual, tc.expect)
77 }) 77 })
78 } 78 }
79 }) 79 })
80 } 80 }
OLDNEW
« no previous file with comments | « service/datastore/serialize/serialize_test.go ('k') | service/datastore/transaction.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698