reflect: uncomment TestAppend and fix a bug it found

Этот коммит содержится в:
Damian Gryski 2023-04-01 11:12:16 -07:00 коммит произвёл Ayke
родитель 60bb832c89
коммит a85cb22193
2 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -874,8 +874,6 @@ var appendTests = []struct {
{make([]int, 2, 4), []int{22, 33, 44}},
}
/*
func TestAppend(t *testing.T) {
for i, test := range appendTests {
origLen, extraLen := len(test.orig), len(test.extra)
@ -935,8 +933,6 @@ func TestAppend(t *testing.T) {
}
}
*/
func TestCopy(t *testing.T) {
a := []int{1, 2, 3, 4, 10, 9, 8, 7}
b := []int{11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44}

Просмотреть файл

@ -1666,6 +1666,7 @@ func (v *Value) extendSlice(n int) {
cap: ncap,
}
v.flags = valueFlagExported
v.value = (unsafe.Pointer)(&newslice)
}