MCPcopy Index your code
hub / github.com/docker/cli / TestAppendNextSteps

Function TestAppendNextSteps

cli-plugins/manager/hooks_test.go:261–291  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

259}
260
261func TestAppendNextSteps(t *testing.T) {
262 testCases := []struct {
263 processed []string
264 expectedOut []string
265 }{
266 {
267 processed: []string{},
268 expectedOut: []string{},
269 },
270 {
271 processed: []string{"", ""},
272 expectedOut: []string{},
273 },
274 {
275 processed: []string{"Some hint", "", "Some other hint"},
276 expectedOut: []string{"Some hint", "", "Some other hint"},
277 },
278 {
279 processed: []string{"Hint 1", "Hint 2"},
280 expectedOut: []string{"Hint 1", "Hint 2"},
281 },
282 }
283
284 for _, tc := range testCases {
285 t.Run("", func(t *testing.T) {
286 got, appended := appendNextSteps([]string{}, tc.processed)
287 assert.Check(t, is.DeepEqual(got, tc.expectedOut))
288 assert.Check(t, is.Equal(appended, len(got) > 0))
289 })
290 }
291}
292
293func TestRunPluginHooksPassesErrorMessage(t *testing.T) {
294 cfg := configfile.New("")

Callers

nothing calls this directly

Calls 1

appendNextStepsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…