Skip to content

Commit 2561ba1

Browse files
committed
more fixes...
1 parent 358583c commit 2561ba1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

roaring64/bsi64_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ func TestSetAndGetBigTimestamp(t *testing.T) {
107107
// Recover and check the known timestamp
108108
bv, _ := bsi.GetBigValue(1)
109109
seconds, nanoseconds := bigIntToSecondsAndNanos(bv)
110-
ts := time.Unix(seconds, int64(nanoseconds))
111-
assert.Equal(t, "3024-10-23T16:55:46.763295273Z", ts.Format(time.RFC3339Nano))
110+
assert.Equal(t, seconds, int64(33286611346))
111+
assert.Equal(t, nanoseconds, int32(763295273))
112112
assert.Equal(t, 67, bsi.BitCount())
113113
}
114114

roaring64/roaring64_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,8 +2015,6 @@ func Test32As64(t *testing.T) {
20152015
func TestRoaringArray64Validation(t *testing.T) {
20162016
a := roaringArray64{}
20172017

2018-
assert.ErrorIs(t, a.validate(), ErrEmptyKeys)
2019-
20202018
a.keys = append(a.keys, uint32(3), uint32(1))
20212019
assert.ErrorIs(t, a.validate(), ErrKeySortOrder)
20222020
a.clear()

roaring64/roaringarray64.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,13 @@ func (ra *roaringArray64) validate() error {
449449
}
450450

451451
for _, maps := range ra.containers {
452-
453452
err := maps.Validate()
454453
if err != nil {
455454
return err
456455
}
456+
if maps.IsEmpty() {
457+
return errors.New("empty container")
458+
}
457459
}
458460

459461
return nil

roaring_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2742,7 +2742,7 @@ func TestRoaringArrayValidation(t *testing.T) {
27422742
a.containers = append(a.containers, &runContainer16{}, &runContainer16{}, &runContainer16{})
27432743
assert.ErrorIs(t, a.validate(), ErrCardinalityConstraint)
27442744
a.needCopyOnWrite = append(a.needCopyOnWrite, true, false, true)
2745-
assert.Errorf(t, a.validate(), "zero intervals")
2745+
assert.ErrorIs(t, a.validate(), ErrRunIntervalsEmpty)
27462746
}
27472747

27482748
func TestBitMapValidation(t *testing.T) {

0 commit comments

Comments
 (0)