github.hscsec.cn/aerogo/aero@v1.0.0/Unsafe_test.go (about) 1 package aero_test 2 3 import ( 4 "testing" 5 6 "github.com/aerogo/aero" 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestBytesToStringUnsafe(t *testing.T) { 11 out := "hello" 12 in := []byte(out) 13 14 assert.Equal(t, out, aero.BytesToStringUnsafe(in)) 15 } 16 17 func TestStringToBytesUnsafe(t *testing.T) { 18 in := "hello" 19 out := []byte(in) 20 21 assert.Equal(t, out, aero.StringToBytesUnsafe(in)) 22 }