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

Function test_add_run_non_recursive

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

Source from the content-addressed store, hash-verified

961 #[test]
962 #[serial]
963 fn test_add_run_non_recursive() {
964 let _guard = DirGuard::new();
965
966 let temp_dir = tempfile::tempdir().unwrap();
967 let repo_path = temp_dir.path();
968
969 // Initialize repository
970 {
971 let _repo = Repository::init(repo_path).unwrap();
972 }
973
974 // Create directory with files
975 let src_dir = repo_path.join("src");
976 std::fs::create_dir(&src_dir).unwrap();
977 std::fs::write(src_dir.join("main.rs"), "fn main() {}").unwrap();
978
979 std::env::set_current_dir(repo_path).unwrap();
980
981 let add = Add::new().with_files(vec!["src"]).with_recursive(false);
982 let result = add.run();
983
984 assert!(
985 result.is_ok(),
986 "Add non-recursive failed: {:?}",
987 result.err()
988 );
989 }
990
991 #[test]
992 #[serial]

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected