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

Function test_add_with_unicode_filename

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

Source from the content-addressed store, hash-verified

1329 #[test]
1330 #[file_serial]
1331 fn test_add_with_unicode_filename() {
1332 let _guard = DirGuard::new();
1333
1334 let temp_dir = tempfile::tempdir().unwrap();
1335 let repo_path = temp_dir.path();
1336
1337 // Initialize repository
1338 {
1339 let _repo = Repository::init(repo_path).unwrap();
1340 }
1341
1342 // Create a file with unicode name
1343 std::fs::write(repo_path.join("文件.txt"), "内容").unwrap();
1344
1345 std::env::set_current_dir(repo_path).unwrap();
1346
1347 let add = Add::new().with_files(vec!["文件.txt"]);
1348 let result = add.run();
1349
1350 assert!(
1351 result.is_ok(),
1352 "Add unicode file failed: {:?}",
1353 result.err()
1354 );
1355 }
1356
1357 #[test]
1358 #[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