(t *testing.T)
| 309 | } |
| 310 | |
| 311 | func TestPrintIssue_WithFilePath(t *testing.T) { |
| 312 | issue := validator.ValidationIssue{ |
| 313 | Level: validator.LevelError, |
| 314 | TaskID: "001", |
| 315 | FilePath: "tasks/001-test.md", |
| 316 | Message: "some issue", |
| 317 | } |
| 318 | |
| 319 | oldStdout := os.Stdout |
| 320 | r, w, _ := os.Pipe() |
| 321 | os.Stdout = w |
| 322 | |
| 323 | printIssue(issue, getRenderer()) |
| 324 | |
| 325 | w.Close() |
| 326 | os.Stdout = oldStdout |
| 327 | |
| 328 | var buf bytes.Buffer |
| 329 | buf.ReadFrom(r) |
| 330 | output := buf.String() |
| 331 | |
| 332 | if !strings.Contains(output, "tasks/001-test.md") { |
| 333 | t.Errorf("expected file path in output, got:\n%s", output) |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | func TestOutputValidationJSON(t *testing.T) { |
| 338 | result := &validator.ValidationResult{ |
nothing calls this directly
no test coverage detected