fix: Fixed the issue of missing cap when StringToBytes returns result (#306)

Co-authored-by: 燕归来 <dylan@infinni.io>
This commit is contained in:
燕归来and燕归来 authored and GitHub committed 2025-05-14 15:08:12 +08:00
1 parent 03f0d4d905
commit e78ac65605
2 files changed
+6 -2

No files matched your search

+2 -1
View File
@@ -518,7 +518,8 @@ func TestStringToBytes(t *testing.T) {
assert := internal.NewAssert(t, "TestStringToBytes")
bytes := StringToBytes("abc")
assert.Equal(bytes, []byte{'a', 'b', 'c'})
assert.Equal([]byte{'a', 'b', 'c'}, bytes)
assert.Equal(3, cap(bytes))
}
func TestBytesToString(t *testing.T) {