github.com/mailgun/holster/v4@v4.20.0/unsafe/unsafe_test.go (about) 1 package unsafe 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestBytesToString(t *testing.T) { 10 assert.Equal(t, "hello", BytesToString([]byte("hello"))) 11 } 12 13 func TestStringToBytes(t *testing.T) { 14 assert.Equal(t, []byte("hello"), StringToBytes("hello")) 15 }