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

Function test_add_run_nested_directory

atomic-cli/src/commands/add.rs:1194–1221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1192 #[test]
1193 #[file_serial]
1194 fn test_add_run_nested_directory() {
1195 let _guard = DirGuard::new();
1196
1197 let temp_dir = tempfile::tempdir().unwrap();
1198 let repo_path = temp_dir.path();
1199
1200 // Initialize repository
1201 {
1202 let _repo = Repository::init(repo_path).unwrap();
1203 }
1204
1205 // Create nested directory structure
1206 let nested = repo_path.join("src").join("utils").join("helpers");
1207 std::fs::create_dir_all(&nested).unwrap();
1208 std::fs::write(nested.join("mod.rs"), "// mod").unwrap();
1209 std::fs::write(repo_path.join("src").join("main.rs"), "fn main() {}").unwrap();
1210
1211 std::env::set_current_dir(repo_path).unwrap();
1212
1213 let add = Add::new().with_files(vec!["src"]);
1214 let result = add.run();
1215
1216 assert!(
1217 result.is_ok(),
1218 "Add nested directory failed: {:?}",
1219 result.err()
1220 );
1221 }
1222
1223 #[test]
1224 #[file_serial]

Callers

nothing calls this directly

Calls 6

initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected