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

Side by Side Diff: impl/memory/memstore_test.go

Issue 2604943002: impl/memory: Replace gkvlite with "treapstore". (Closed)
Patch Set: Comments. Created 3 years, 11 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 | « impl/memory/memstore_iter_test.go ('k') | impl/memory/memstore_tracing_utils.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 memory 5 package memory
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 9
10 . "github.com/smartystreets/goconvey/convey" 10 . "github.com/smartystreets/goconvey/convey"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 ret := store.GetOrCreateCollection("") 103 ret := store.GetOrCreateCollection("")
104 for _, i := range fill { 104 for _, i := range fill {
105 ret.Set(i.k, i.v) 105 ret.Set(i.k, i.v)
106 } 106 }
107 return store.Snapshot().GetCollection("") 107 return store.Snapshot().GetCollection("")
108 } 108 }
109 109
110 func TestCollision(t *testing.T) { 110 func TestCollision(t *testing.T) {
111 t.Parallel() 111 t.Parallel()
112 112
113 » Convey("Test gkvCollide", t, func() { 113 » Convey("Test memStoreCollide", t, func() {
114 for _, tc := range testCollisionCases { 114 for _, tc := range testCollisionCases {
115 Convey(tc.name, func() { 115 Convey(tc.name, func() {
116 left := getFilledColl(tc.left) 116 left := getFilledColl(tc.left)
117 right := getFilledColl(tc.right) 117 right := getFilledColl(tc.right)
118 i := 0 118 i := 0
119 » » » » gkvCollide(left, right, func(key, left, right [] byte) { 119 » » » » memStoreCollide(left, right, func(key, left, rig ht []byte) {
120 e := tc.expect[i] 120 e := tc.expect[i]
121 So(key, ShouldResemble, e.key) 121 So(key, ShouldResemble, e.key)
122 So(left, ShouldResemble, e.left) 122 So(left, ShouldResemble, e.left)
123 So(right, ShouldResemble, e.right) 123 So(right, ShouldResemble, e.right)
124 i++ 124 i++
125 }) 125 })
126 So(i, ShouldEqual, len(tc.expect)) 126 So(i, ShouldEqual, len(tc.expect))
127 }) 127 })
128 } 128 }
129 }) 129 })
130 } 130 }
OLDNEW
« no previous file with comments | « impl/memory/memstore_iter_test.go ('k') | impl/memory/memstore_tracing_utils.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698