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:297–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295
296#[test]
297fn test_write_file_simple() {
298 let (dir, fs) = temp_fs();
299
300 {
301 let mut writer = fs.write_file("output.txt", Inode::new(1)).unwrap();
302 writer.write_all(b"hello world").unwrap();
303 }
304
305 let contents = std::fs::read_to_string(dir.path().join("output.txt")).unwrap();
306 assert_eq!(contents, "hello world");
307}
308
309#[test]
310fn 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