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

Source from the content-addressed store, hash-verified

1179 #[test]
1180 #[serial]
1181 fn test_add_with_unicode_filename() {
1182 let _guard = DirGuard::new();
1183
1184 let temp_dir = tempfile::tempdir().unwrap();
1185 let repo_path = temp_dir.path();
1186
1187 // Initialize repository
1188 {
1189 let _repo = Repository::init(repo_path).unwrap();
1190 }
1191
1192 // Create a file with unicode name
1193 std::fs::write(repo_path.join("文件.txt"), "内容").unwrap();
1194
1195 std::env::set_current_dir(repo_path).unwrap();
1196
1197 let add = Add::new().with_files(vec!["文件.txt"]);
1198 let result = add.run();
1199
1200 assert!(
1201 result.is_ok(),
1202 "Add unicode file failed: {:?}",
1203 result.err()
1204 );
1205 }
1206
1207 #[test]
1208 #[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