validatedOutput validates the given slice of lines against data from the given reader.
(r io.Reader, want []string)
| 261 | |
| 262 | // validatedOutput validates the given slice of lines against data from the given reader. |
| 263 | func validateOutput(r io.Reader, want []string) bool { |
| 264 | s := bufio.NewScanner(r) |
| 265 | for _, line := range want { |
| 266 | if !s.Scan() || !strings.Contains(s.Text(), line) { |
| 267 | return false |
| 268 | } |
| 269 | } |
| 270 | return true |
| 271 | } |
| 272 | |
| 273 | var validateOutputTests = []struct { |
| 274 | input string |
no outgoing calls
no test coverage detected
searching dependent graphs…