Lines Matching full:append
7 // Semi-exhaustive test for the append predeclared function.
38 {"bool a", append([]bool{}), []bool{}},
39 {"bool b", append([]bool{}, true), []bool{true}},
40 {"bool c", append([]bool{}, true, false, true, true), []bool{true, false, true, true}},
42 {"bool d", append([]bool{true, false, true}), []bool{true, false, true}},
43 {"bool e", append([]bool{true, false, true}, false), []bool{true, false, true, false}},
44 {"bool f", append([]bool{true, false, true}, false, false, false), []bool{true, false, true, false, false, false}},
46 {"bool g", append([]bool{}, []bool{true}...), []bool{true}},
47 {"bool h", append([]bool{}, []bool{true, false, true, false}...), []bool{true, false, true, false}},
49 {"bool i", append([]bool{true, false, true}, []bool{true}...), []bool{true, false, true, true}},
50 {"bool j", append([]bool{true, false, true}, []bool{true, true, true}...), []bool{true, false, true, true, true, true}},
53 {"byte a", append([]byte{}), []byte{}},
54 {"byte b", append([]byte{}, 0), []byte{0}},
55 {"byte c", append([]byte{}, 0, 1, 2, 3), []byte{0, 1, 2, 3}},
57 {"byte d", append([]byte{0, 1, 2}), []byte{0, 1, 2}},
58 {"byte e", append([]byte{0, 1, 2}, 3), []byte{0, 1, 2, 3}},
59 {"byte f", append([]byte{0, 1, 2}, 3, 4, 5), []byte{0, 1, 2, 3, 4, 5}},
61 {"byte g", append([]byte{}, []byte{0}...), []byte{0}},
62 {"byte h", append([]byte{}, []byte{0, 1, 2, 3}...), []byte{0, 1, 2, 3}},
64 {"byte i", append([]byte{0, 1, 2}, []byte{3}...), []byte{0, 1, 2, 3}},
65 {"byte j", append([]byte{0, 1, 2}, []byte{3, 4, 5}...), []byte{0, 1, 2, 3, 4, 5}},
67 {"bytestr a", append([]byte{}, "0"...), []byte("0")},
68 {"bytestr b", append([]byte{}, "0123"...), []byte("0123")},
70 {"bytestr c", append([]byte("012"), "3"...), []byte("0123")},
71 {"bytestr d", append([]byte("012"), "345"...), []byte("012345")},
73 {"int16 a", append([]int16{}), []int16{}},
74 {"int16 b", append([]int16{}, 0), []int16{0}},
75 {"int16 c", append([]int16{}, 0, 1, 2, 3), []int16{0, 1, 2, 3}},
77 {"int16 d", append([]int16{0, 1, 2}), []int16{0, 1, 2}},
78 {"int16 e", append([]int16{0, 1, 2}, 3), []int16{0, 1, 2, 3}},
79 {"int16 f", append([]int16{0, 1, 2}, 3, 4, 5), []int16{0, 1, 2, 3, 4, 5}},
81 {"int16 g", append([]int16{}, []int16{0}...), []int16{0}},
82 {"int16 h", append([]int16{}, []int16{0, 1, 2, 3}...), []int16{0, 1, 2, 3}},
84 {"int16 i", append([]int16{0, 1, 2}, []int16{3}...), []int16{0, 1, 2, 3}},
85 {"int16 j", append([]int16{0, 1, 2}, []int16{3, 4, 5}...), []int16{0, 1, 2, 3, 4, 5}},
88 {"uint32 a", append([]uint32{}), []uint32{}},
89 {"uint32 b", append([]uint32{}, 0), []uint32{0}},
90 {"uint32 c", append([]uint32{}, 0, 1, 2, 3), []uint32{0, 1, 2, 3}},
92 {"uint32 d", append([]uint32{0, 1, 2}), []uint32{0, 1, 2}},
93 {"uint32 e", append([]uint32{0, 1, 2}, 3), []uint32{0, 1, 2, 3}},
94 {"uint32 f", append([]uint32{0, 1, 2}, 3, 4, 5), []uint32{0, 1, 2, 3, 4, 5}},
96 {"uint32 g", append([]uint32{}, []uint32{0}...), []uint32{0}},
97 {"uint32 h", append([]uint32{}, []uint32{0, 1, 2, 3}...), []uint32{0, 1, 2, 3}},
99 {"uint32 i", append([]uint32{0, 1, 2}, []uint32{3}...), []uint32{0, 1, 2, 3}},
100 {"uint32 j", append([]uint32{0, 1, 2}, []uint32{3, 4, 5}...), []uint32{0, 1, 2, 3, 4, 5}},
103 {"float64 a", append([]float64{}), []float64{}},
104 {"float64 b", append([]float64{}, 0), []float64{0}},
105 {"float64 c", append([]float64{}, 0, 1, 2, 3), []float64{0, 1, 2, 3}},
107 {"float64 d", append([]float64{0, 1, 2}), []float64{0, 1, 2}},
108 {"float64 e", append([]float64{0, 1, 2}, 3), []float64{0, 1, 2, 3}},
109 {"float64 f", append([]float64{0, 1, 2}, 3, 4, 5), []float64{0, 1, 2, 3, 4, 5}},
111 {"float64 g", append([]float64{}, []float64{0}...), []float64{0}},
112 {"float64 h", append([]float64{}, []float64{0, 1, 2, 3}...), []float64{0, 1, 2, 3}},
114 {"float64 i", append([]float64{0, 1, 2}, []float64{3}...), []float64{0, 1, 2, 3}},
115 {"float64 j", append([]float64{0, 1, 2}, []float64{3, 4, 5}...), []float64{0, 1, 2, 3, 4, 5}},
118 {"complex128 a", append([]complex128{}), []complex128{}},
119 {"complex128 b", append([]complex128{}, 0), []complex128{0}},
120 {"complex128 c", append([]complex128{}, 0, 1, 2, 3), []complex128{0, 1, 2, 3}},
122 {"complex128 d", append([]complex128{0, 1, 2}), []complex128{0, 1, 2}},
123 {"complex128 e", append([]complex128{0, 1, 2}, 3), []complex128{0, 1, 2, 3}},
124 {"complex128 f", append([]complex128{0, 1, 2}, 3, 4, 5), []complex128{0, 1, 2, 3, 4, 5}},
126 {"complex128 g", append([]complex128{}, []complex128{0}...), []complex128{0}},
127 {"complex128 h", append([]complex128{}, []complex128{0, 1, 2, 3}...), []complex128{0, 1, 2, 3}},
129 {"complex128 i", append([]complex128{0, 1, 2}, []complex128{3}...), []complex128{0, 1, 2, 3}},
130 {"complex128 j", append([]complex128{0, 1, 2}, []complex128{3, 4, 5}...), []complex128{0, 1, 2, 3, 4, 5}},
133 {"string a", append([]string{}), []string{}},
134 {"string b", append([]string{}, "0"), []string{"0"}},
135 {"string c", append([]string{}, "0", "1", "2", "3"), []string{"0", "1", "2", "3"}},
137 {"string d", append([]string{"0", "1", "2"}), []string{"0", "1", "2"}},
138 {"string e", append([]string{"0", "1", "2"}, "3"), []string{"0", "1", "2", "3"}},
139 {"string f", append([]string{"0", "1", "2"}, "3", "4", "5"), []string{"0", "1", "2", "3", "4", "5"}},
141 {"string g", append([]string{}, []string{"0"}...), []string{"0"}},
142 {"string h", append([]string{}, []string{"0", "1", "2", "3"}...), []string{"0", "1", "2", "3"}},
144 {"string i", append([]string{"0", "1", "2"}, []string{"3"}...), []string{"0", "1", "2", "3"}},
145 {"string j", append([]string{"0", "1", "2"}, []string{"3", "4", "5"}...), []string{"0", "1", "2", "3", "4", "5"}},
159 verify("struct a", append(S{}), S{})
160 verify("struct b", append(S{}, e[0]), e[0:1])
161 verify("struct c", append(S{}, e[0], e[1], e[2]), e[0:3])
163 verify("struct d", append(e[0:1]), e[0:1])
164 verify("struct e", append(e[0:1], e[1]), e[0:2])
165 verify("struct f", append(e[0:1], e[1], e[2], e[3]), e[0:4])
167 verify("struct g", append(e[0:3]), e[0:3])
168 verify("struct h", append(e[0:3], e[3]), e[0:4])
169 verify("struct i", append(e[0:3], e[3], e[4], e[5], e[6]), e[0:7])
172 verify("struct j", append(S{}, e[0:i]...), e[0:i])
175 verify("struct k", append(input, e[i:]...), e)
184 verify("struct l", append(s), s)
185 verify("struct m", append(s, e...), r)
206 verify("interface a", append(S{}), S{})
207 verify("interface b", append(S{}, e[0]), e[0:1])
208 verify("interface c", append(S{}, e[0], e[1], e[2]), e[0:3])
210 verify("interface d", append(e[0:1]), e[0:1])
211 verify("interface e", append(e[0:1], e[1]), e[0:2])
212 verify("interface f", append(e[0:1], e[1], e[2], e[3]), e[0:4])
214 verify("interface g", append(e[0:3]), e[0:3])
215 verify("interface h", append(e[0:3], e[3]), e[0:4])
216 verify("interface i", append(e[0:3], e[3], e[4], e[5], e[6]), e[0:7])
219 verify("interface j", append(S{}, e[0:i]...), e[0:i])
222 verify("interface k", append(input, e[i:]...), e)
231 verify("interface l", append(s), s)
232 verify("interface m", append(s, e...), r)
239 // The second argument to append has type []E where E is the
242 // not assignment compatible. The return type of append is
246 verify("T1", append(t1, t2...), T1{1, 2})