MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_write_file_simple

Function test_write_file_simple

atomic-core/src/output/filesystem/tests.rs:319–329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

317
318#[test]
319fn test_write_file_simple() {
320 let (dir, fs) = temp_fs();
321
322 {
323 let mut writer = fs.write_file("output.txt", Inode::new(1)).unwrap();
324 writer.write_all(b"hello world").unwrap();
325 }
326
327 let contents = std::fs::read_to_string(dir.path().join("output.txt")).unwrap();
328 assert_eq!(contents, "hello world");
329}
330
331#[test]
332fn test_write_file_creates_parents() {

Callers

nothing calls this directly

Calls 4

temp_fsFunction · 0.85
unwrapMethod · 0.45
write_fileMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected