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

Function test_rename_directory

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

Source from the content-addressed store, hash-verified

511
512#[test]
513fn test_rename_directory() {
514 let (dir, fs) = temp_fs();
515 std::fs::create_dir(dir.path().join("old_dir")).unwrap();
516 std::fs::write(dir.path().join("old_dir/file.txt"), "content").unwrap();
517
518 fs.rename("old_dir", "new_dir").unwrap();
519
520 assert!(!dir.path().join("old_dir").exists());
521 assert!(dir.path().join("new_dir/file.txt").exists());
522}
523
524#[test]
525fn test_rename_creates_parent() {

Callers

nothing calls this directly

Calls 5

temp_fsFunction · 0.85
writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected