MCPcopy Create free account
hub / github.com/driangle/taskmd / TestPrintIssue_WithFilePath

Function TestPrintIssue_WithFilePath

apps/cli/internal/cli/validate_test.go:311–335  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

309}
310
311func 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
337func TestOutputValidationJSON(t *testing.T) {
338 result := &validator.ValidationResult{

Callers

nothing calls this directly

Calls 2

printIssueFunction · 0.85
getRendererFunction · 0.85

Tested by

no test coverage detected