github.com/milvus-io/milvus-sdk-go/v2@v2.4.1/entity/segment_test.go (about)

     1  package entity
     2  
     3  import (
     4  	"testing"
     5  
     6  	common "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  func TestSegmentFlushed(t *testing.T) {
    11  	segment := &Segment{}
    12  	assert.False(t, segment.Flushed())
    13  	segment.State = common.SegmentState_Growing
    14  	assert.False(t, segment.Flushed())
    15  	segment.State = common.SegmentState_Flushing
    16  	assert.False(t, segment.Flushed())
    17  	segment.State = common.SegmentState_Flushed
    18  	assert.True(t, segment.Flushed())
    19  }