github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/core/utils/convert/convert_test.go (about)

     1  package convert
     2  
     3  import (
     4  	"github.com/stretchr/testify/assert"
     5  	"testing"
     6  )
     7  
     8  func TestConvert(t *testing.T) {
     9  	const Str = "1234567891234567891"
    10  	assert.Equal(t, len(StringToBytes(Str)), len(Str))
    11  	assert.Equal(t, cap(StringToBytes(Str)), len(Str))
    12  	assert.Equal(t, len(BytesToString(StringToBytes(Str))), len(Str))
    13  }