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

Unified Diff: impl/memory/race_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 | « impl/memory/datastore_test.go ('k') | impl/memory/testing_utils_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/race_test.go
diff --git a/impl/memory/race_test.go b/impl/memory/race_test.go
index 2768e1d1359ab3b8f2706e2f2fc0af22f32aabb2..79eb5c4e04b2d33903799a3eece83c5d36437e9a 100644
--- a/impl/memory/race_test.go
+++ b/impl/memory/race_test.go
@@ -38,12 +38,12 @@ func TestRaceGetPut(t *testing.T) {
t.Fatal("error get", err)
}
cur := int64(0)
- if ps, ok := obj["Value"]; ok {
+ if ps := obj.Slice("Value"); len(ps) > 0 {
cur = ps[0].Value().(int64)
}
cur++
- obj["Value"] = []datastore.Property{prop(cur)}
+ obj["Value"] = prop(cur)
return ds.Put(obj)
}, &datastore.TransactionOptions{Attempts: 200})
@@ -62,8 +62,8 @@ func TestRaceGetPut(t *testing.T) {
t.FailNow()
}
t.Logf("Ran %d inner functions", num)
- if int64(value) != obj["Value"][0].Value().(int64) {
- t.Fatalf("value wrong value %d v %d", value, obj["Value"][0].Value().(int64))
+ if int64(value) != obj.Slice("Value")[0].Value().(int64) {
+ t.Fatalf("value wrong value %d v %d", value, obj.Slice("Value")[0].Value().(int64))
}
}
« no previous file with comments | « impl/memory/datastore_test.go ('k') | impl/memory/testing_utils_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698