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

Function test_add_run_single_file

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

Source from the content-addressed store, hash-verified

952 #[test]
953 #[file_serial]
954 fn test_add_run_single_file() {
955 let _guard = DirGuard::new();
956
957 let temp_dir = tempfile::tempdir().unwrap();
958 let repo_path = temp_dir.path();
959
960 // Initialize repository
961 {
962 let _repo = Repository::init(repo_path).unwrap();
963 }
964
965 // Create a file to add
966 std::fs::write(repo_path.join("test.txt"), "Hello, World!").unwrap();
967
968 std::env::set_current_dir(repo_path).unwrap();
969
970 let add = Add::new().with_files(vec!["test.txt"]);
971 let result = add.run();
972
973 assert!(result.is_ok(), "Add failed: {:?}", result.err());
974 }
975
976 #[test]
977 #[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