| 2360 | #[test] |
| 2361 | #[cfg(unix)] |
| 2362 | fn test_sync_default_agents_case_insensitive() { |
| 2363 | let temp_dir = TempDir::new().unwrap(); |
| 2364 | let agents_dir = temp_dir.path().join(".agents"); |
| 2365 | fs::create_dir_all(&agents_dir).unwrap(); |
| 2366 | |
| 2367 | let source_file = agents_dir.join("AGENTS.md"); |
| 2368 | fs::write(&source_file, "# Test").unwrap(); |
| 2369 | |
| 2370 | let config_path = agents_dir.join("agentsync.toml"); |
| 2371 | let config_content = r#" |
| 2372 | source_dir = "." |
| 2373 | default_agents = ["CLAUDE", "COPILOT"] |
| 2374 | |
| 2375 | [agents.claude-code] |
| 2376 | enabled = true |
| 2377 | [agents.claude-code.targets.main] |
| 2378 | source = "AGENTS.md" |
| 2379 | destination = "CLAUDE.md" |
| 2380 | type = "symlink" |
| 2381 | |
| 2382 | [agents.GitHub-Copilot] |
| 2383 | enabled = true |
| 2384 | [agents.GitHub-Copilot.targets.main] |
| 2385 | source = "AGENTS.md" |
| 2386 | destination = "COPILOT.md" |
| 2387 | type = "symlink" |
| 2388 | "#; |
| 2389 | fs::write(&config_path, config_content).unwrap(); |
| 2390 | |
| 2391 | let config = Config::load(&config_path).unwrap(); |
| 2392 | let linker = Linker::new(config, config_path); |
| 2393 | |
| 2394 | // Should match case-insensitively using default_agents |
| 2395 | let options = SyncOptions::default(); |
| 2396 | let result = linker.sync(&options).unwrap(); |
| 2397 | |
| 2398 | assert_eq!(result.created, 2); |
| 2399 | assert!(temp_dir.path().join("CLAUDE.md").exists()); |
| 2400 | assert!(temp_dir.path().join("COPILOT.md").exists()); |
| 2401 | } |
| 2402 | |
| 2403 | #[test] |
| 2404 | #[cfg(unix)] |