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

Function test_rename_file

atomic-core/src/output/memory.rs:993–1002  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

991
992 #[test]
993 fn test_rename_file() {
994 let wc = Memory::new();
995 wc.add_file("old.txt", b"content");
996
997 wc.rename("old.txt", "new.txt").unwrap();
998
999 assert!(!wc.exists("old.txt"));
1000 assert!(wc.exists("new.txt"));
1001 assert_eq!(wc.get_file_contents("new.txt").unwrap(), b"content");
1002 }
1003
1004 #[test]
1005 fn test_rename_directory() {

Callers

nothing calls this directly

Calls 3

add_fileMethod · 0.45
unwrapMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected