(t *testing.T)
| 150 | } |
| 151 | |
| 152 | func 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 | |
| 176 | func TestOutputValidationText_WithErrors(t *testing.T) { |
| 177 | result := &validator.ValidationResult{ |
nothing calls this directly
no test coverage detected