(t *testing.T)
| 229 | } |
| 230 | |
| 231 | func TestOutputValidationText_Quiet(t *testing.T) { |
| 232 | result := &validator.ValidationResult{ |
| 233 | Issues: []validator.ValidationIssue{}, |
| 234 | TaskCount: 3, |
| 235 | } |
| 236 | |
| 237 | oldStdout := os.Stdout |
| 238 | r, w, _ := os.Pipe() |
| 239 | os.Stdout = w |
| 240 | |
| 241 | outputValidationText(result, true) |
| 242 | |
| 243 | w.Close() |
| 244 | os.Stdout = oldStdout |
| 245 | |
| 246 | var buf bytes.Buffer |
| 247 | buf.ReadFrom(r) |
| 248 | output := buf.String() |
| 249 | |
| 250 | if output != "" { |
| 251 | t.Errorf("expected no output in quiet mode, got:\n%s", output) |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | func TestPrintIssue_WithTaskID(t *testing.T) { |
| 256 | issue := validator.ValidationIssue{ |
nothing calls this directly
no test coverage detected