fix(convertor): clone array values without slice reflection (#380)

This commit is contained in:
Yusuf Efe authored and GitHub committed 2026-10-23 18:03:23 +08:00
1 parent 417cf68bd8
commit 86dc6c0019
2 files changed
+19 -2

No files matched your search

+12
View File
@@ -394,6 +394,18 @@ func TestDecodeByte(t *testing.T) {
assert.Equal("abc", obj)
}
func TestDeepCloneArrays(t *testing.T) {
assert := internal.NewAssert(t, "TestDeepCloneArrays")
value := 42
type pair [2]*int
src := pair{&value, nil}
got := DeepClone(src)
assert.Equal(src, got)
*got[0] = 99
assert.Equal(42, *src[0])
assert.Equal([0]int{}, DeepClone([0]int{}))
}
func TestDeepClone(t *testing.T) {
t.Parallel()