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

Unified Diff: service/datastore/serialize/serialize_test.go

Issue 2342063003: Differentiate between single- and multi- props. (Closed)
Patch Set: Slice is now always a clone. This is marginally worse performance, but a much safer UI. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « service/datastore/serialize/serialize.go ('k') | service/datastore/size_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/serialize/serialize_test.go
diff --git a/service/datastore/serialize/serialize_test.go b/service/datastore/serialize/serialize_test.go
index d6c9b9f65453e9030f7eecb5803414cc64f22309..5c975f0e23384eeef2e195fe78d5c92220a785d3 100644
--- a/service/datastore/serialize/serialize_test.go
+++ b/service/datastore/serialize/serialize_test.go
@@ -57,38 +57,38 @@ func TestPropertyMapSerialization(t *testing.T) {
{
"basic",
ds.PropertyMap{
- "R": {mp(false), mp(2.1), mpNI(3)},
- "S": {mp("hello"), mp("world")},
+ "R": ds.PropertySlice{mp(false), mp(2.1), mpNI(3)},
+ "S": ds.PropertySlice{mp("hello"), mp("world")},
},
},
{
"keys",
ds.PropertyMap{
- "DS": {
+ "DS": ds.PropertySlice{
mp(mkKey("appy", "ns", "Foo", 7)),
mp(mkKey("other", "", "Yot", "wheeep")),
mp((*ds.Key)(nil)),
},
- "blobstore": {mp(blobstore.Key("sup")), mp(blobstore.Key("nerds"))},
+ "blobstore": ds.PropertySlice{mp(blobstore.Key("sup")), mp(blobstore.Key("nerds"))},
},
},
{
"geo",
ds.PropertyMap{
- "G": {mp(ds.GeoPoint{Lat: 1, Lng: 2})},
+ "G": mp(ds.GeoPoint{Lat: 1, Lng: 2}),
},
},
{
"data",
ds.PropertyMap{
- "S": {mp("sup"), mp("fool"), mp("nerd")},
- "D.Foo.Nerd": {mp([]byte("sup")), mp([]byte("fool"))},
+ "S": ds.PropertySlice{mp("sup"), mp("fool"), mp("nerd")},
+ "D.Foo.Nerd": ds.PropertySlice{mp([]byte("sup")), mp([]byte("fool"))},
},
},
{
"time",
ds.PropertyMap{
- "T": {
+ "T": ds.PropertySlice{
mp(now),
mp(now.Add(time.Second)),
},
@@ -97,10 +97,10 @@ func TestPropertyMapSerialization(t *testing.T) {
{
"empty vals",
ds.PropertyMap{
- "T": {mp(true), mp(true)},
- "F": {mp(false), mp(false)},
- "N": {mp(nil), mp(nil)},
- "E": {},
+ "T": ds.PropertySlice{mp(true), mp(true)},
+ "F": ds.PropertySlice{mp(false), mp(false)},
+ "N": ds.PropertySlice{mp(nil), mp(nil)},
+ "E": ds.PropertySlice{},
},
},
}
@@ -482,9 +482,9 @@ func TestPartialSerialization(t *testing.T) {
Convey("TestPartialSerialization", t, func() {
Convey("list", func() {
pm := ds.PropertyMap{
- "wat": {mpNI("thing"), mp("hat"), mp(100)},
- "nerd": {mp(103.7)},
- "spaz": {mpNI(false)},
+ "wat": ds.PropertySlice{mpNI("thing"), mp("hat"), mp(100)},
+ "nerd": mp(103.7),
+ "spaz": mpNI(false),
}
sip := PropertyMapPartially(fakeKey, pm)
So(len(sip), ShouldEqual, 4)
« no previous file with comments | « service/datastore/serialize/serialize.go ('k') | service/datastore/size_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698