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:1303–1327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1301 #[test]
1302 #[file_serial]
1303 fn test_add_with_path_containing_spaces() {
1304 let _guard = DirGuard::new();
1305
1306 let temp_dir = tempfile::tempdir().unwrap();
1307 let repo_path = temp_dir.path();
1308
1309 // Initialize repository
1310 {
1311 let _repo = Repository::init(repo_path).unwrap();
1312 }
1313
1314 // Create a file with spaces in name
1315 std::fs::write(repo_path.join("my file.txt"), "content").unwrap();
1316
1317 std::env::set_current_dir(repo_path).unwrap();
1318
1319 let add = Add::new().with_files(vec!["my file.txt"]);
1320 let result = add.run();
1321
1322 assert!(
1323 result.is_ok(),
1324 "Add file with spaces failed: {:?}",
1325 result.err()
1326 );
1327 }
1328
1329 #[test]
1330 #[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