reflect: uncomment TestAppend and fix a bug it found

This commit is contained in:
Damian Gryski
2023-04-01 11:12:16 -07:00
committed by Ayke
parent 60bb832c89
commit a85cb22193
2 changed files with 1 additions and 4 deletions
-4
View File
@@ -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}
+1
View File
@@ -1666,6 +1666,7 @@ func (v *Value) extendSlice(n int) {
cap: ncap,
}
v.flags = valueFlagExported
v.value = (unsafe.Pointer)(&newslice)
}