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

Function TestOutputValidationText_NoIssues

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

Source from the content-addressed store, hash-verified

150}
151
152func TestOutputValidationText_NoIssues(t *testing.T) {
153 result := &validator.ValidationResult{
154 Issues: []validator.ValidationIssue{},
155 TaskCount: 5,
156 }
157
158 oldStdout := os.Stdout
159 r, w, _ := os.Pipe()
160 os.Stdout = w
161
162 outputValidationText(result, false)
163
164 w.Close()
165 os.Stdout = oldStdout
166
167 var buf bytes.Buffer
168 buf.ReadFrom(r)
169 output := buf.String()
170
171 if !strings.Contains(output, "5 task(s) are valid") {
172 t.Errorf("expected success message, got:\n%s", output)
173 }
174}
175
176func TestOutputValidationText_WithErrors(t *testing.T) {
177 result := &validator.ValidationResult{

Callers

nothing calls this directly

Calls 1

outputValidationTextFunction · 0.85

Tested by

no test coverage detected