(t *testing.T)
| 147 | } |
| 148 | |
| 149 | func TestAppend(t *testing.T) { |
| 150 | ctx := log.Testing(t) |
| 151 | |
| 152 | for _, test := range []struct { |
| 153 | data []int |
| 154 | val interface{} |
| 155 | expected []int |
| 156 | }{ |
| 157 | // Insertion (with: slice). |
| 158 | {[]int{1, 2, 3}, []int{7, 8, 9}, []int{1, 2, 3, 7, 8, 9}}, |
| 159 | {[]int{1, 2, 3}, []int{9}, []int{1, 2, 3, 9}}, |
| 160 | |
| 161 | // Insertion (with: element). |
| 162 | {[]int{1, 2, 3}, 9, []int{1, 2, 3, 9}}, |
| 163 | } { |
| 164 | got := make([]int, len(test.data)) |
| 165 | copy(got, test.data) |
| 166 | slice.Append(&got, test.val) |
| 167 | assert.For(ctx, "Append(%v, %v)", test.data, test.val). |
| 168 | That(got).DeepEquals(test.expected) |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | func TestReverse(t *testing.T) { |
| 173 | ctx := log.Testing(t) |
nothing calls this directly
no test coverage detected