github.com/sykesm/fabric@v1.1.0-preview.0.20200129034918-2aa12b1a0181/common/ledger/blkstorage/blockstorage_test.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package blkstorage
     8  
     9  import (
    10  	"testing"
    11  
    12  	"github.com/stretchr/testify/assert"
    13  )
    14  
    15  func TestIndexConfig(t *testing.T) {
    16  	ic := &IndexConfig{
    17  		AttrsToIndex: []IndexableAttr{
    18  			IndexableAttrBlockNum,
    19  			IndexableAttrTxID,
    20  		},
    21  	}
    22  
    23  	assert := assert.New(t)
    24  	assert.True(ic.Contains(IndexableAttrBlockNum))
    25  	assert.True(ic.Contains(IndexableAttrTxID))
    26  	assert.False(ic.Contains(IndexableAttrBlockNumTranNum))
    27  }