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

Function test_add_run_all_untracked

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

Source from the content-addressed store, hash-verified

991 #[test]
992 #[serial]
993 fn test_add_run_all_untracked() {
994 let _guard = DirGuard::new();
995
996 let temp_dir = tempfile::tempdir().unwrap();
997 let repo_path = temp_dir.path();
998
999 // Initialize repository
1000 {
1001 let _repo = Repository::init(repo_path).unwrap();
1002 }
1003
1004 // Create untracked files
1005 std::fs::write(repo_path.join("file1.txt"), "Content 1").unwrap();
1006 std::fs::write(repo_path.join("file2.txt"), "Content 2").unwrap();
1007
1008 std::env::set_current_dir(repo_path).unwrap();
1009
1010 let add = Add::new().with_all(true);
1011 let result = add.run();
1012
1013 assert!(result.is_ok(), "Add --all failed: {:?}", result.err());
1014 }
1015
1016 #[test]
1017 #[serial]

Callers

nothing calls this directly

Calls 5

writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
with_allMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected