(t *testing.T)
| 135 | } |
| 136 | |
| 137 | func 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 | |
| 166 | func TestPrintAllWithSpaces(t *testing.T) { |
| 167 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…