()
| 357 | |
| 358 | #[test] |
| 359 | fn test_write_file_binary() { |
| 360 | let (dir, fs) = temp_fs(); |
| 361 | let binary_data: Vec<u8> = (0..=255).collect(); |
| 362 | |
| 363 | { |
| 364 | let mut writer = fs.write_file("binary.bin", Inode::new(1)).unwrap(); |
| 365 | writer.write_all(&binary_data).unwrap(); |
| 366 | } |
| 367 | |
| 368 | let contents = std::fs::read(dir.path().join("binary.bin")).unwrap(); |
| 369 | assert_eq!(contents, binary_data); |
| 370 | } |
| 371 | |
| 372 | #[test] |
| 373 | fn test_file_writer_inode() { |