MCPcopy Index your code
hub / github.com/ddev/ddev / TestArrayToReadableOutput

Function TestArrayToReadableOutput

pkg/util/utils_test.go:233–249  ·  view source on GitHub ↗

TestArrayToReadableOutput tests ArrayToReadableOutput

(t *testing.T)

Source from the content-addressed store, hash-verified

231
232// TestArrayToReadableOutput tests ArrayToReadableOutput
233func TestArrayToReadableOutput(t *testing.T) {
234 assert := asrt.New(t)
235
236 testSource := []string{
237 "file1.conf",
238 "file2.conf",
239 }
240 expectation := `
241 - file1.conf
242 - file2.conf
243`
244 res, _ := util.ArrayToReadableOutput(testSource)
245 assert.Equal(expectation, res)
246
247 _, err := util.ArrayToReadableOutput([]string{})
248 assert.EqualErrorf(err, "empty slice", "Expected error when passing an empty slice")
249}
250
251// TestGetTimezone tests GetTimezone
252func TestGetTimezone(t *testing.T) {

Callers

nothing calls this directly

Calls 1

ArrayToReadableOutputFunction · 0.92

Tested by

no test coverage detected