mirror of
https://github.com/golang/go
synced 2024-11-22 01:54:42 -07:00
reflect: remove unnecessary indirection in TestCopy.
R=r CC=golang-dev https://golang.org/cl/3642041
This commit is contained in:
parent
670e77b54d
commit
d96685ed6a
@ -549,15 +549,13 @@ func TestCopy(t *testing.T) {
|
|||||||
a := []int{1, 2, 3, 4, 10, 9, 8, 7}
|
a := []int{1, 2, 3, 4, 10, 9, 8, 7}
|
||||||
b := []int{11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44}
|
b := []int{11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44}
|
||||||
c := []int{11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44}
|
c := []int{11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44}
|
||||||
va := NewValue(&a)
|
|
||||||
vb := NewValue(&b)
|
|
||||||
for i := 0; i < len(b); i++ {
|
for i := 0; i < len(b); i++ {
|
||||||
if b[i] != c[i] {
|
if b[i] != c[i] {
|
||||||
t.Fatalf("b != c before test")
|
t.Fatalf("b != c before test")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aa := va.(*PtrValue).Elem().(*SliceValue)
|
aa := NewValue(a).(*SliceValue)
|
||||||
ab := vb.(*PtrValue).Elem().(*SliceValue)
|
ab := NewValue(b).(*SliceValue)
|
||||||
for tocopy := 1; tocopy <= 7; tocopy++ {
|
for tocopy := 1; tocopy <= 7; tocopy++ {
|
||||||
aa.SetLen(tocopy)
|
aa.SetLen(tocopy)
|
||||||
Copy(ab, aa)
|
Copy(ab, aa)
|
||||||
|
Loading…
Reference in New Issue
Block a user