pkg/str/str_conv_test.go
2023-09-18 15:51:20 +08:00

18 lines
334 B
Go

package str
import "testing"
func TestConv(t *testing.T) {
tmp := "测试字符"
bs := []byte("测试字符")
t.Run("byte -> string", func(t *testing.T) {
t.Log(B2S(bs))
})
t.Run("string -> byte", func(t *testing.T) {
t.Log(S2B(tmp))
})
t.Run("string -> byte -> string", func(t *testing.T) {
t.Log(B2S(S2B(tmp)))
})
}