fix differenceInPlace test

This commit is contained in:
Travis 2020-01-30 13:38:31 -06:00
parent 8de32fd62a
commit 0bdcb5ab0a
2 changed files with 4 additions and 6 deletions

View file

@ -5518,7 +5518,6 @@ func (b *Bitmap) DifferenceInPlace(others ...*Bitmap) {
} else {
break
}
}
if targetKey == iKey {

View file

@ -166,7 +166,6 @@ func eq(a, b []uint64) bool {
func TestRow_DifferenceInPlace2(t *testing.T) {
lucky := []uint64{1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79, 87, 93, 99, 105, 111, 115, 127, 129, 133, 135, 141, 151, 159, 163, 169, 171, 189, 193, 195, 201, 205, 211, 219, 223, 231, 235, 237, 241, 259, 261, 267, 273, 283, 285, 289, 297}
src := pilosa.NewRow(lucky...)
fmt.Println(src.Columns())
row1 := pilosa.NewRow()
m := uint64(9)
for i := m; i <= lucky[len(lucky)-1]; i += m {
@ -190,10 +189,10 @@ func TestRow_DifferenceInPlace2(t *testing.T) {
res5 := src.Difference(row1, row2, row3, row4)
res6 := src.Difference(row4, row3, row2, row1)
res7 := src.Difference(row4).Difference(row3).Difference(row2).Difference(row1)
if eq(res5.Columns(), res6.Columns()) {
t.Fatal("should match")
if !eq(res5.Columns(), res6.Columns()) {
t.Fatalf("results do not match: %v, %v", res5.Columns(), res6.Columns())
}
if eq(res6.Columns(), res7.Columns()) {
t.Fatal("should match")
if !eq(res6.Columns(), res7.Columns()) {
t.Fatalf("results do not match: %v, %v", res6.Columns(), res7.Columns())
}
}