()
| 470 | |
| 471 | #[test] |
| 472 | fn test_rewrite_with_line_ending() -> io::Result<()> { |
| 473 | let mut file = NamedTempFile::new()?; |
| 474 | write!(file, "Line 1\nLine 2\n")?; |
| 475 | file.flush()?; |
| 476 | |
| 477 | rewrite_with_line_ending(file.path(), "\r\n")?; |
| 478 | let data = fs::read(file.path())?; |
| 479 | assert!(data.windows(2).any(|w| w == b"\r\n")); |
| 480 | for i in 0..data.len() { |
| 481 | if data[i] == b'\n' { |
| 482 | assert!(i > 0 && data[i - 1] == b'\r'); |
| 483 | } |
| 484 | } |
| 485 | Ok(()) |
| 486 | } |
| 487 | |
| 488 | /// Executes `image` through completion in `vm`, and converts the result into an exit code. |
| 489 | async fn run_image(vm: &mut Vm, image: &Image) -> Result<i32, String> { |
nothing calls this directly
no test coverage detected