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

Function test_add_with_path_containing_spaces

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

Source from the content-addressed store, hash-verified

1151 #[test]
1152 #[serial]
1153 fn test_add_with_path_containing_spaces() {
1154 let _guard = DirGuard::new();
1155
1156 let temp_dir = tempfile::tempdir().unwrap();
1157 let repo_path = temp_dir.path();
1158
1159 // Initialize repository
1160 {
1161 let _repo = Repository::init(repo_path).unwrap();
1162 }
1163
1164 // Create a file with spaces in name
1165 std::fs::write(repo_path.join("my file.txt"), "content").unwrap();
1166
1167 std::env::set_current_dir(repo_path).unwrap();
1168
1169 let add = Add::new().with_files(vec!["my file.txt"]);
1170 let result = add.run();
1171
1172 assert!(
1173 result.is_ok(),
1174 "Add file with spaces failed: {:?}",
1175 result.err()
1176 );
1177 }
1178
1179 #[test]
1180 #[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