mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(convertor): clone array values without slice reflection (#380)
This commit is contained in:
1 parent
417cf68bd8
commit
86dc6c0019
2 files changed
+19
-2
No files matched your search
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user