OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // 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" |
11 ) | 11 ) |
12 | 12 |
13 type keyLeftRight struct{ key, left, right []byte } | 13 type keyLeftRight struct{ key, left, right []byte } |
14 | 14 |
| 15 type kv struct{ k, v []byte } |
| 16 |
15 var testCollisionCases = []struct { | 17 var testCollisionCases = []struct { |
16 name string | 18 name string |
17 left, right []kv // inserts into left and right collections | 19 left, right []kv // inserts into left and right collections |
18 expect []keyLeftRight | 20 expect []keyLeftRight |
19 }{ | 21 }{ |
20 { | 22 { |
21 name: "nil", | 23 name: "nil", |
22 }, | 24 }, |
23 { | 25 { |
24 name: "empty", | 26 name: "empty", |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 So(key, ShouldResemble, e.key) | 121 So(key, ShouldResemble, e.key) |
120 So(left, ShouldResemble, e.left) | 122 So(left, ShouldResemble, e.left) |
121 So(right, ShouldResemble, e.right) | 123 So(right, ShouldResemble, e.right) |
122 i++ | 124 i++ |
123 }) | 125 }) |
124 So(i, ShouldEqual, len(tc.expect)) | 126 So(i, ShouldEqual, len(tc.expect)) |
125 }) | 127 }) |
126 } | 128 } |
127 }) | 129 }) |
128 } | 130 } |
OLD | NEW |