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

Source from the content-addressed store, hash-verified

1541
1542 #[test]
1543 fn test_collect_working_copy_files() {
1544 use tempfile::TempDir;
1545
1546 let temp_dir = TempDir::new().unwrap();
1547 let root = temp_dir.path();
1548
1549 // Create some files
1550 std::fs::write(root.join("file1.txt"), b"content1").unwrap();
1551 std::fs::create_dir_all(root.join("src")).unwrap();
1552 std::fs::write(root.join("src/main.rs"), b"fn main() {}").unwrap();
1553
1554 // Create .atomic directory (should be ignored)
1555 std::fs::create_dir_all(root.join(".atomic")).unwrap();
1556 std::fs::write(root.join(".atomic/config.toml"), b"test").unwrap();
1557
1558 let options = StatusOptions::default();
1559 let files = collect_working_copy_files(root, &options).unwrap();
1560
1561 assert!(files.contains(&PathBuf::from("file1.txt")));
1562 assert!(files.contains(&PathBuf::from("src/main.rs")));
1563 assert!(!files.contains(&PathBuf::from(".atomic/config.toml")));
1564 }
1565
1566 #[test]
1567 fn test_collect_working_copy_files_with_filter() {

Callers

nothing calls this directly

Calls 4

writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected