@@ -179,7 +179,7 @@ func createHLVForTest(tb *testing.T, input string) *HybridLogicalVector {
179
179
return hlv
180
180
}
181
181
182
- func TestAddNewerVersions (t * testing.T ) {
182
+ func TestHLVAddNewerVersions (t * testing.T ) {
183
183
testCases := []struct {
184
184
name string
185
185
existingHLV string
@@ -211,6 +211,46 @@ func TestAddNewerVersions(t *testing.T) {
211
211
incomingHLV : "4@c" ,
212
212
finalHLV : "4@c;2@b,1@a" ,
213
213
},
214
+ {
215
+ name : "incoming pv overwrite mv, equal values" ,
216
+ existingHLV : "3@c,2@b,1@a" ,
217
+ incomingHLV : "4@c;2@b,1@a" ,
218
+ finalHLV : "4@c;2@b,1@a" ,
219
+ },
220
+ {
221
+ name : "incoming mv overwrite pv, equal values" ,
222
+ existingHLV : "3@c;2@b,1@a" ,
223
+ incomingHLV : "4@c,2@b,1@a" ,
224
+ finalHLV : "4@c,2@b,1@a" ,
225
+ },
226
+ {
227
+ name : "incoming mv overwrite pv, greater values" ,
228
+ existingHLV : "3@c;2@b,1@a" ,
229
+ incomingHLV : "4@c,5@b,6@a" ,
230
+ finalHLV : "4@c,5@b,6@a" ,
231
+ },
232
+ /* FIXME, this does not work yet.
233
+ {
234
+ name: "incoming does not dominate pv",
235
+ existingHLV: "3@c;5@b,6@a",
236
+ incomingHLV: "4@c,1@b,2@a",
237
+ finalHLV: "3@c;5@b,6@a",
238
+ },
239
+ */
240
+ {
241
+ name : "incoming mv partially overlaps with pv" ,
242
+ existingHLV : "3@c;2@b,1@a" ,
243
+ incomingHLV : "4@c,2@b,6@a" ,
244
+ finalHLV : "4@c,2@b,6@a" ,
245
+ },
246
+ /* FIXME: this doesn't work yet
247
+ {
248
+ name: "incoming mv partially overlaps with pv, but incoming mv should be wiped out",
249
+ existingHLV: "3@c;2@b,6@a",
250
+ incomingHLV: "4@c,2@b,1@a",
251
+ finalHLV: "4@c;2@b,6@a",
252
+ },
253
+ */
214
254
}
215
255
216
256
for _ , test := range testCases {
0 commit comments