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

Function TestPrintDescriptionAsFallback

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

Source from the content-addressed store, hash-verified

135}
136
137func TestPrintDescriptionAsFallback(t *testing.T) {
138 t.Parallel()
139
140 buffer, l := createDummyLogger()
141 taskWithoutSummary := &ast.Task{
142 Desc: "description",
143 }
144
145 taskWithSummary := &ast.Task{
146 Desc: "description",
147 Summary: "summary",
148 }
149 taskWithoutSummaryOrDescription := &ast.Task{}
150
151 summary.PrintTask(&l, taskWithoutSummary)
152
153 assert.Contains(t, buffer.String(), "description")
154
155 buffer.Reset()
156 summary.PrintTask(&l, taskWithSummary)
157
158 assert.NotContains(t, buffer.String(), "description")
159
160 buffer.Reset()
161 summary.PrintTask(&l, taskWithoutSummaryOrDescription)
162
163 assert.Contains(t, buffer.String(), "\n(task does not have description or summary)\n")
164}
165
166func TestPrintAllWithSpaces(t *testing.T) {
167 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…