mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
issue: https://github.com/milvus-io/milvus/issues/32783 This pr is the implementation of lru cache on branch lru-dev. Signed-off-by: sunby <sunbingyi1992@gmail.com> Co-authored-by: chyezh <chyezh@outlook.com> Co-authored-by: MrPresent-Han <chun.han@zilliz.com> Co-authored-by: Ted Xu <ted.xu@zilliz.com> Co-authored-by: jaime <yun.zhang@zilliz.com> Co-authored-by: wayblink <anyang.wang@zilliz.com>
21 lines
419 B
Go
21 lines
419 B
Go
package segments
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestFilterZeroValuesFromSlice(t *testing.T) {
|
|
var ints []int64
|
|
ints = append(ints, 10)
|
|
ints = append(ints, 0)
|
|
ints = append(ints, 5)
|
|
ints = append(ints, 13)
|
|
ints = append(ints, 0)
|
|
|
|
filteredInts := FilterZeroValuesFromSlice(ints)
|
|
assert.Equal(t, 3, len(filteredInts))
|
|
assert.EqualValues(t, []int64{10, 5, 13}, filteredInts)
|
|
}
|