github.com/datachainlab/burrow@v0.25.0/storage/kvstore_test.go (about)

     1  package storage
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestCompareKeys(t *testing.T) {
    10  	assert.Equal(t, 1, CompareKeys(nil, []byte{2}))
    11  	assert.Equal(t, -1, CompareKeys([]byte{2}, nil))
    12  	assert.Equal(t, -1, CompareKeys([]byte{}, nil))
    13  	assert.Equal(t, 1, CompareKeys(nil, []byte{}))
    14  	assert.Equal(t, 0, CompareKeys(nil, nil))
    15  	assert.Equal(t, -1, CompareKeys([]byte{1, 2, 3}, []byte{2}))
    16  }