Skip to content

Commit dd955e0

Browse files
committed
Add additional test cases
1 parent e00b93e commit dd955e0

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

db/hybrid_logical_vector_test.go

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func createHLVForTest(tb *testing.T, input string) *HybridLogicalVector {
179179
return hlv
180180
}
181181

182-
func TestAddNewerVersions(t *testing.T) {
182+
func TestHLVAddNewerVersions(t *testing.T) {
183183
testCases := []struct {
184184
name string
185185
existingHLV string
@@ -211,6 +211,46 @@ func TestAddNewerVersions(t *testing.T) {
211211
incomingHLV: "4@c",
212212
finalHLV: "4@c;2@b,1@a",
213213
},
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+
*/
214254
}
215255

216256
for _, test := range testCases {

0 commit comments

Comments
 (0)