MCPcopy Create free account
hub / github.com/algolia/cli / TestSliceToString

Function TestSliceToString

pkg/utils/utils_test.go:169–202  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

167}
168
169func 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
204func TestSliceToReadableString(t *testing.T) {
205 tests := []struct {

Callers

nothing calls this directly

Calls 2

SliceToStringFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected