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