(t *testing.T)
| 167 | } |
| 168 | |
| 169 | func TestSliceToString(t *testing.T) { |
| 170 | tests := []struct { |
| 171 | name string |
| 172 | input []string |
| 173 | expected string |
| 174 | }{ |
| 175 | { |
| 176 | name: "no element", |
| 177 | input: []string{""}, |
| 178 | expected: "", |
| 179 | }, |
| 180 | { |
| 181 | name: "one element", |
| 182 | input: []string{"maguro"}, |
| 183 | expected: "maguro", |
| 184 | }, |
| 185 | { |
| 186 | name: "two elements", |
| 187 | input: []string{"maguro", "otoro"}, |
| 188 | expected: "maguro, otoro", |
| 189 | }, |
| 190 | { |
| 191 | name: "three elements", |
| 192 | input: []string{"maguro", "otoro", "tamago"}, |
| 193 | expected: "maguro, otoro, tamago", |
| 194 | }, |
| 195 | } |
| 196 | |
| 197 | for _, tt := range tests { |
| 198 | t.Run(tt.name, func(t *testing.T) { |
| 199 | assert.Equal(t, tt.expected, SliceToString(tt.input)) |
| 200 | }) |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | func TestSliceToReadableString(t *testing.T) { |
| 205 | tests := []struct { |
nothing calls this directly
no test coverage detected