diff --git a/convertor/convertor_test.go b/convertor/convertor_test.go index 4970f9c..6797dd1 100644 --- a/convertor/convertor_test.go +++ b/convertor/convertor_test.go @@ -238,3 +238,21 @@ func TestToPointer(t *testing.T) { assert.Equal(*result, 123) } + +func TestEncodeByte(t *testing.T) { + assert := internal.NewAssert(t, "TestEncodeByte") + + byteData, _ := EncodeByte("abc") + expected := []byte{6, 12, 0, 3, 97, 98, 99} + + assert.Equal(expected, byteData) +} + +func TestDecodeByte(t *testing.T) { + assert := internal.NewAssert(t, "TestDecodeByte") + + var obj string + byteData := []byte{6, 12, 0, 3, 97, 98, 99} + DecodeByte(byteData, &obj) + assert.Equal("abc", obj) +}