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

Unified Diff: filter/txnBuf/txnbuf_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 | « filter/txnBuf/query_merger.go ('k') | impl/cloud/datastore.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/txnBuf/txnbuf_test.go
diff --git a/filter/txnBuf/txnbuf_test.go b/filter/txnBuf/txnbuf_test.go
index c39d0e58f209f46ccba267cff5f18f80a9d27bc4..8fd4336473e38ba313d2eb518e5e3ea0019061cf 100644
--- a/filter/txnBuf/txnbuf_test.go
+++ b/filter/txnBuf/txnbuf_test.go
@@ -530,7 +530,7 @@ func TestQuerySupport(t *testing.T) {
for i, pm := range vals {
So(datastore.GetMetaDefault(pm, "key", nil), ShouldResemble,
ds.MakeKey("Parent", 1, "Foo", expect[i].id))
- So(pm["Value"][0].Value(), ShouldEqual, expect[i].val)
+ So(pm.Slice("Value")[0].Value(), ShouldEqual, expect[i].val)
}
// should remove 4 entries, but there are plenty more to fill
@@ -561,7 +561,7 @@ func TestQuerySupport(t *testing.T) {
for i, pm := range vals {
So(datastore.GetMetaDefault(pm, "key", nil), ShouldResemble,
ds.MakeKey("Parent", 1, "Foo", expect[i].id))
- So(pm["Value"][0].Value(), ShouldEqual, expect[i].val)
+ So(pm.Slice("Value")[0].Value(), ShouldEqual, expect[i].val)
}
So(ds.Put(&Foo{ID: 1, Parent: root, Value: []int64{3, 9}}), ShouldBeNil)
@@ -591,7 +591,7 @@ func TestQuerySupport(t *testing.T) {
for i, pm := range vals {
So(datastore.GetMetaDefault(pm, "key", nil), ShouldResemble,
ds.MakeKey("Parent", 1, "Foo", expect[i].id))
- So(pm["Value"][0].Value(), ShouldEqual, expect[i].val)
+ So(pm.Slice("Value")[0].Value(), ShouldEqual, expect[i].val)
}
return nil
@@ -644,7 +644,7 @@ func TestQuerySupport(t *testing.T) {
}
for i, pm := range vals {
- So(pm["Value"][0].Value(), ShouldEqual, expect[i].val)
+ So(pm.Slice("Value")[0].Value(), ShouldEqual, expect[i].val)
So(datastore.GetMetaDefault(pm, "key", nil), ShouldResemble,
ds.MakeKey("Parent", 1, "Foo", expect[i].id))
}
@@ -752,7 +752,7 @@ func TestQuerySupport(t *testing.T) {
}
for i, pm := range vals {
- So(pm["Value"][0].Value(), ShouldEqual, expect[i].val)
+ So(pm.Slice("Value")[0].Value(), ShouldEqual, expect[i].val)
So(datastore.GetMetaDefault(pm, "key", nil), ShouldResemble,
ds.MakeKey("Parent", 1, "Foo", expect[i].id))
}
@@ -892,14 +892,14 @@ func TestQuerySupport(t *testing.T) {
return ds.Run(q, func(pm datastore.PropertyMap) {
So(ds.RunInTransaction(func(c context.Context) error {
ds := datastore.Get(c)
- pm["Value"] = append(pm["Value"], datastore.MkProperty("wat"))
+ pm["Value"] = append(pm.Slice("Value"), datastore.MkProperty("wat"))
return ds.Put(pm)
}, nil), ShouldBeNil)
})
}, &datastore.TransactionOptions{XG: true}), ShouldBeNil)
So(ds.Run(datastore.NewQuery("Foo"), func(pm datastore.PropertyMap) {
- val := pm["Value"]
+ val := pm.Slice("Value")
So(val[len(val)-1].Value(), ShouldResemble, "wat")
}), ShouldBeNil)
})
« no previous file with comments | « filter/txnBuf/query_merger.go ('k') | impl/cloud/datastore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698