Obtains the line ending used in `golden` file.
(golden: &Path)
| 439 | |
| 440 | /// Obtains the line ending used in `golden` file. |
| 441 | fn line_ending_for(golden: &Path) -> io::Result<&'static str> { |
| 442 | let text = fs::read_to_string(golden)?; |
| 443 | if text.contains("\r\n") { Ok("\r\n") } else { Ok("\n") } |
| 444 | } |
| 445 | |
| 446 | #[test] |
| 447 | fn test_line_ending_for_crlf() -> io::Result<()> { |