()
| 1044 | |
| 1045 | #[test] |
| 1046 | fn test_write_file() { |
| 1047 | let wc = Memory::new(); |
| 1048 | let inode = wc.allocate_inode(); |
| 1049 | |
| 1050 | { |
| 1051 | let mut writer = wc.write_file("test.txt", inode).unwrap(); |
| 1052 | writer.write_all(b"hello").unwrap(); |
| 1053 | writer.write_all(b" world").unwrap(); |
| 1054 | } |
| 1055 | |
| 1056 | let contents = wc.get_file_contents("test.txt").unwrap(); |
| 1057 | assert_eq!(contents, b"hello world"); |
| 1058 | } |
| 1059 | |
| 1060 | #[test] |
| 1061 | fn test_write_file_creates_parent_dirs() { |
nothing calls this directly
no test coverage detected