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

Function test_rename_file

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

Source from the content-addressed store, hash-verified

496
497#[test]
498fn test_rename_file() {
499 let (dir, fs) = temp_fs();
500 std::fs::write(dir.path().join("old.txt"), "content").unwrap();
501
502 fs.rename("old.txt", "new.txt").unwrap();
503
504 assert!(!dir.path().join("old.txt").exists());
505 assert!(dir.path().join("new.txt").exists());
506 assert_eq!(
507 std::fs::read_to_string(dir.path().join("new.txt")).unwrap(),
508 "content"
509 );
510}
511
512#[test]
513fn test_rename_directory() {

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