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

Side by Side Diff: filter/dscache/dscache_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 unified diff | Download patch
« no previous file with comments | « filter/count/count_test.go ('k') | filter/featureBreaker/featurebreaker_test.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 dscache 5 package dscache
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "encoding/binary" 9 "encoding/binary"
10 "errors" 10 "errors"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 Convey("enabled cases", func() { 86 Convey("enabled cases", func() {
87 c = FilterRDS(c, shardsForKey) 87 c = FilterRDS(c, shardsForKey)
88 ds := datastore.Get(c) 88 ds := datastore.Get(c)
89 So(dsUnder, ShouldNotBeNil) 89 So(dsUnder, ShouldNotBeNil)
90 So(ds, ShouldNotBeNil) 90 So(ds, ShouldNotBeNil)
91 So(mc, ShouldNotBeNil) 91 So(mc, ShouldNotBeNil)
92 92
93 Convey("basically works", func() { 93 Convey("basically works", func() {
94 pm := datastore.PropertyMap{ 94 pm := datastore.PropertyMap{
95 » » » » » "BigData": {datastore.MkProperty([]byte( ""))}, 95 » » » » » "BigData": datastore.MkProperty([]byte(" ")),
96 » » » » » "Value": {datastore.MkProperty("hi")}, 96 » » » » » "Value": datastore.MkProperty("hi"),
97 } 97 }
98 encoded := append([]byte{0}, serialize.ToBytes(p m)...) 98 encoded := append([]byte{0}, serialize.ToBytes(p m)...)
99 99
100 o := object{ID: 1, Value: "hi"} 100 o := object{ID: 1, Value: "hi"}
101 So(ds.Put(&o), ShouldBeNil) 101 So(ds.Put(&o), ShouldBeNil)
102 102
103 o = object{ID: 1} 103 o = object{ID: 1}
104 So(dsUnder.Get(&o), ShouldBeNil) 104 So(dsUnder.Get(&o), ShouldBeNil)
105 So(o.Value, ShouldEqual, "hi") 105 So(o.Value, ShouldEqual, "hi")
106 106
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 InstanceEnabledStatic = false 452 InstanceEnabledStatic = false
453 defer func() { 453 defer func() {
454 InstanceEnabledStatic = true 454 InstanceEnabledStatic = true
455 }() 455 }()
456 456
457 c := context.Background() 457 c := context.Background()
458 newC := FilterRDS(c, nil) 458 newC := FilterRDS(c, nil)
459 So(newC, ShouldEqual, c) 459 So(newC, ShouldEqual, c)
460 }) 460 })
461 } 461 }
OLDNEW
« no previous file with comments | « filter/count/count_test.go ('k') | filter/featureBreaker/featurebreaker_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698