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

Side by Side Diff: filter/txnBuf/txnbuf_test.go

Issue 2353063004: Add "MkKeyContext" KeyContext generation function. (Closed)
Patch Set: 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/dscache/serialize.go ('k') | impl/memory/datastore_data.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 txnBuf 5 package txnBuf
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "math/rand" 10 "math/rand"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 return ShouldBeNil(ds.Put(c, f)) 88 return ShouldBeNil(ds.Put(c, f))
89 } 89 }
90 } 90 }
91 91
92 var ( 92 var (
93 dataMultiRoot = make([]*Foo, 20) 93 dataMultiRoot = make([]*Foo, 20)
94 dataSingleRoot = make([]*Foo, 20) 94 dataSingleRoot = make([]*Foo, 20)
95 hugeField = make([]byte, DefaultSizeBudget/8) 95 hugeField = make([]byte, DefaultSizeBudget/8)
96 hugeData = make([]*Foo, 11) 96 hugeData = make([]*Foo, 11)
97 » root = ds.KeyContext{"something~else", ""}.MakeKey("Parent", 1 ) 97 » root = ds.MkKeyContext("something~else", "").MakeKey("Parent", 1)
98 ) 98 )
99 99
100 func init() { 100 func init() {
101 cb := func(i int64) string { 101 cb := func(i int64) string {
102 buf := &bytes.Buffer{} 102 buf := &bytes.Buffer{}
103 cmpbin.WriteInt(buf, i) 103 cmpbin.WriteInt(buf, i)
104 return buf.String() 104 return buf.String()
105 } 105 }
106 106
107 rs := rand.NewSource(0) 107 rs := rand.NewSource(0)
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 val := pm.Slice("Value") 855 val := pm.Slice("Value")
856 So(val[len(val)-1].Value(), ShouldResemb le, "wat") 856 So(val[len(val)-1].Value(), ShouldResemb le, "wat")
857 }), ShouldBeNil) 857 }), ShouldBeNil)
858 }) 858 })
859 859
860 }) 860 })
861 861
862 }) 862 })
863 863
864 } 864 }
OLDNEW
« no previous file with comments | « filter/dscache/serialize.go ('k') | impl/memory/datastore_data.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698