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:1044–1071  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1042 #[test]
1043 #[serial]
1044 fn test_add_run_nested_directory() {
1045 let _guard = DirGuard::new();
1046
1047 let temp_dir = tempfile::tempdir().unwrap();
1048 let repo_path = temp_dir.path();
1049
1050 // Initialize repository
1051 {
1052 let _repo = Repository::init(repo_path).unwrap();
1053 }
1054
1055 // Create nested directory structure
1056 let nested = repo_path.join("src").join("utils").join("helpers");
1057 std::fs::create_dir_all(&nested).unwrap();
1058 std::fs::write(nested.join("mod.rs"), "// mod").unwrap();
1059 std::fs::write(repo_path.join("src").join("main.rs"), "fn main() {}").unwrap();
1060
1061 std::env::set_current_dir(repo_path).unwrap();
1062
1063 let add = Add::new().with_files(vec!["src"]);
1064 let result = add.run();
1065
1066 assert!(
1067 result.is_ok(),
1068 "Add nested directory failed: {:?}",
1069 result.err()
1070 );
1071 }
1072
1073 #[test]
1074 #[serial]

Callers

nothing calls this directly

Calls 5

writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected