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

Function test_rename_file

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

Source from the content-addressed store, hash-verified

518
519#[test]
520fn test_rename_file() {
521 let (dir, fs) = temp_fs();
522 std::fs::write(dir.path().join("old.txt"), "content").unwrap();
523
524 fs.rename("old.txt", "new.txt").unwrap();
525
526 assert!(!dir.path().join("old.txt").exists());
527 assert!(dir.path().join("new.txt").exists());
528 assert_eq!(
529 std::fs::read_to_string(dir.path().join("new.txt")).unwrap(),
530 "content"
531 );
532}
533
534#[test]
535fn test_rename_directory() {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected