Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

test(config): drop misleading mutual-exclusivity tests (#3348)

Worktrunk Bot3fe004aeea3e
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 752dd9448..aefa83209 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -551,66 +551,6 @@ task2 = "echo 'Task 2 running' > task2.txt"
assert_eq!(result, "/path/to/repo/target -> /path/to/worktree/target");
}
- #[test]
- fn test_commit_generation_config_mutually_exclusive_validation() {
- // Test that deserialization rejects both template and template-file
- let toml_content = r#"
-worktree-path = "../{{ main_worktree }}.{{ branch }}"
-
-[commit.generation]
-command = "llm"
-template = "inline template"
-template-file = "~/file.txt"
-"#;
-
- // Parse the TOML directly
- let config_result: Result<UserConfig, _> = toml::from_str(toml_content);
-
- // The deserialization should succeed, but validation in load() would fail
- // Since we can't easily test load() without env vars, we verify the fields deserialize
- if let Ok(config) = config_result {
- let generation = config.commit.generation.as_ref();
- // Verify validation logic: both fields should not be Some
- let has_both = generation
- .map(|g| g.template.is_some() && g.template_file.is_some())
- .unwrap_or(false);
- assert!(
- has_both,
- "Config should have both template fields set for this test"
- );
- }
- }
-
- #[test]
- fn test_squash_template_mutually_exclusive_validation() {
- // Test that deserialization rejects both squash-template and squash-template-file
- let toml_content = r#"
-worktree-path = "../{{ main_worktree }}.{{ branch }}"
-
-[commit.generation]
-command = "llm"
-squash-template = "inline template"
-squash-template-file = "~/file.txt"
-"#;
-
- // Parse the TOML directly
- let config_result: Result<UserConfig, _> = toml::from_str(toml_content);
-
- // The deserialization should succeed, but validation in load() would fail
- // Since we can't easily test load() without env vars, we verify the fields deserialize
- if let Ok(config) = config_result {
- let generation = config.commit.generation.as_ref();
- // Verify validation logic: both fields should not be Some
- let has_both = generation
- .map(|g| g.squash_template.is_some() && g.squash_template_file.is_some())
- .unwrap_or(false);
- assert!(
- has_both,
- "Config should have both squash template fields set for this test"
- );
- }
- }
-
#[test]
fn test_commit_generation_config_serialization() {
let config = CommitGenerationConfig {