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

Function test_rename_directory

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

Source from the content-addressed store, hash-verified

1003
1004 #[test]
1005 fn test_rename_directory() {
1006 let wc = Memory::new();
1007 wc.add_file("old/a.txt", b"a");
1008 wc.add_file("old/b.txt", b"b");
1009
1010 wc.rename("old", "new").unwrap();
1011
1012 assert!(!wc.exists("old"));
1013 assert!(!wc.exists("old/a.txt"));
1014 assert!(wc.exists("new"));
1015 assert!(wc.exists("new/a.txt"));
1016 assert!(wc.exists("new/b.txt"));
1017 }
1018
1019 #[test]
1020 fn test_rename_not_found() {

Callers

nothing calls this directly

Calls 3

add_fileMethod · 0.45
unwrapMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected