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

Function test_collect_working_copy_files

atomic-repository/src/status.rs:1250–1271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1248
1249 #[test]
1250 fn test_collect_working_copy_files() {
1251 use tempfile::TempDir;
1252
1253 let temp_dir = TempDir::new().unwrap();
1254 let root = temp_dir.path();
1255
1256 // Create some files
1257 std::fs::write(root.join("file1.txt"), b"content1").unwrap();
1258 std::fs::create_dir_all(root.join("src")).unwrap();
1259 std::fs::write(root.join("src/main.rs"), b"fn main() {}").unwrap();
1260
1261 // Create .atomic directory (should be ignored)
1262 std::fs::create_dir_all(root.join(".atomic")).unwrap();
1263 std::fs::write(root.join(".atomic/config.toml"), b"test").unwrap();
1264
1265 let options = StatusOptions::default();
1266 let files = collect_working_copy_files(root, &options).unwrap();
1267
1268 assert!(files.contains(&PathBuf::from("file1.txt")));
1269 assert!(files.contains(&PathBuf::from("src/main.rs")));
1270 assert!(!files.contains(&PathBuf::from(".atomic/config.toml")));
1271 }
1272
1273 #[test]
1274 fn test_collect_working_copy_files_with_filter() {

Callers

nothing calls this directly

Calls 4

writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected