From f10bbd8443b2ce7a5ce78d79264bc2f941025c22 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 14:04:37 +0000 Subject: [PATCH] test: remove duplicate tests in safeoutputs add_pr_comment and comment_on_work_item - add_pr_comment: test_allowed_statuses_case_insensitive_reverse is a symmetric duplicate of test_allowed_statuses_case_insensitive_match. eq_ignore_ascii_case is definitionally symmetric so testing the reverse direction adds no coverage. - comment_on_work_item: test_config_partial_deserialize_uses_defaults has an identical body to test_config_deserializes_from_yaml (same YAML input, same assertion). Remove the weaker-named duplicate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/safeoutputs/add_pr_comment.rs | 20 -------------------- src/safeoutputs/comment_on_work_item.rs | 8 -------- 2 files changed, 28 deletions(-) diff --git a/src/safeoutputs/add_pr_comment.rs b/src/safeoutputs/add_pr_comment.rs index 9a45f62e..3eea584a 100644 --- a/src/safeoutputs/add_pr_comment.rs +++ b/src/safeoutputs/add_pr_comment.rs @@ -630,26 +630,6 @@ allowed-statuses: ); } - #[test] - fn test_allowed_statuses_case_insensitive_reverse() { - // Config has "active" but agent sends "Active" — should be allowed - let config = AddPrCommentConfig { - comment_prefix: None, - allowed_repositories: Vec::new(), - allowed_statuses: vec!["active".to_string()], - include_stats: true, - }; - let status = "Active"; - let matched = config - .allowed_statuses - .iter() - .any(|s| s.eq_ignore_ascii_case(status)); - assert!( - matched, - "uppercase 'Active' should match config value 'active'" - ); - } - #[test] fn test_sanitize_content_neutralizes_repository_pipeline_command() { let params = AddPrCommentParams { diff --git a/src/safeoutputs/comment_on_work_item.rs b/src/safeoutputs/comment_on_work_item.rs index 24fc9f6c..c8b10a45 100644 --- a/src/safeoutputs/comment_on_work_item.rs +++ b/src/safeoutputs/comment_on_work_item.rs @@ -490,13 +490,5 @@ max: 3 assert!(config.target.is_none()); } - #[test] - fn test_config_partial_deserialize_uses_defaults() { - let yaml = r#" -target: "*" -"#; - let config: CommentOnWorkItemConfig = serde_yaml::from_str(yaml).unwrap(); - assert!(config.target.is_some()); - } }