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

Function test_add_run_dry_run

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

Source from the content-addressed store, hash-verified

1028 #[test]
1029 #[file_serial]
1030 fn test_add_run_dry_run() {
1031 let _guard = DirGuard::new();
1032
1033 let temp_dir = tempfile::tempdir().unwrap();
1034 let repo_path = temp_dir.path();
1035
1036 // Initialize repository
1037 {
1038 let _repo = Repository::init(repo_path).unwrap();
1039 }
1040
1041 // Create a file
1042 std::fs::write(repo_path.join("test.txt"), "Hello").unwrap();
1043
1044 std::env::set_current_dir(repo_path).unwrap();
1045
1046 let add = Add::new().with_files(vec!["test.txt"]).with_dry_run(true);
1047 let result = add.run();
1048
1049 assert!(result.is_ok(), "Dry run failed: {:?}", result.err());
1050
1051 // Verify file was not actually tracked
1052 {
1053 let repo = Repository::open(repo_path).unwrap();
1054 assert!(!repo.is_tracked("test.txt").unwrap_or(true));
1055 }
1056 }
1057
1058 #[test]
1059 #[file_serial]

Callers

nothing calls this directly

Calls 8

openFunction · 0.85
initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
with_dry_runMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected