MCPcopy Index your code
hub / github.com/go-task/task / TestPrintTaskCommandsIfPresent

Function TestPrintTaskCommandsIfPresent

internal/summary/summary_test.go:68–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestPrintTaskCommandsIfPresent(t *testing.T) {
69 t.Parallel()
70
71 buffer, l := createDummyLogger()
72 task := &ast.Task{
73 Cmds: []*ast.Cmd{
74 {Cmd: "command-1"},
75 {Cmd: "command-2"},
76 {Task: "task-1"},
77 },
78 }
79
80 summary.PrintTask(&l, task)
81
82 assert.Contains(t, buffer.String(), "\ncommands:\n")
83 assert.Contains(t, buffer.String(), "\n - command-1\n")
84 assert.Contains(t, buffer.String(), "\n - command-2\n")
85 assert.Contains(t, buffer.String(), "\n - Task: task-1\n")
86}
87
88func TestDoesNotPrintCommandIfMissing(t *testing.T) {
89 t.Parallel()

Callers

nothing calls this directly

Calls 3

PrintTaskFunction · 0.92
createDummyLoggerFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…