filterDiffMetadata removes information from the diff output that is test-run specific for ex. removing directory name being used.
(r io.Reader)
| 251 | // filterDiffMetadata removes information from the diff output that is test-run |
| 252 | // specific for ex. removing directory name being used. |
| 253 | func filterDiffMetadata(r io.Reader) string { |
| 254 | scanner := bufio.NewScanner(r) |
| 255 | b := &bytes.Buffer{} |
| 256 | |
| 257 | for scanner.Scan() { |
| 258 | text := scanner.Text() |
| 259 | // filter out the diff command that contains directory names |
| 260 | if strings.HasPrefix(text, "diff ") { |
| 261 | continue |
| 262 | } |
| 263 | b.WriteString(text) |
| 264 | b.WriteString("\n") |
| 265 | } |
| 266 | return b.String() |
| 267 | } |
| 268 | |
| 269 | func TestStagingDirectoryNames(t *testing.T) { |
| 270 | var tests = []struct { |
no test coverage detected