(t *testing.T, expectedFile string, actualContents string)
| 174 | } |
| 175 | |
| 176 | func assertFileHasContents(t *testing.T, expectedFile string, actualContents string) { |
| 177 | expectedBuf, err := ioutil.ReadFile(expectedFile) |
| 178 | if err != nil { |
| 179 | log.Fatalf("Loading %v - %v", expectedFile, err) |
| 180 | } |
| 181 | expected := strings.TrimSpace(string(normalizeNewlines(expectedBuf))) |
| 182 | actual := strings.TrimSpace(string(normalizeNewlines([]byte(actualContents)))) |
| 183 | assert.Equal(t, expected, actual, "File %v", expectedFile) |
| 184 | } |
| 185 | |
| 186 | // NormalizeNewlines normalizes \r\n (windows) and \r (mac) |
| 187 | // into \n (unix) |
no test coverage detected