diff --git a/guards/github-guard/rust-guard/src/labels/mod.rs b/guards/github-guard/rust-guard/src/labels/mod.rs index b2bddb91..504dcaad 100644 --- a/guards/github-guard/rust-guard/src/labels/mod.rs +++ b/guards/github-guard/rust-guard/src/labels/mod.rs @@ -703,6 +703,39 @@ mod tests { assert_eq!(desc2, "pr:github/copilot#456"); } + #[test] + fn test_apply_tool_labels_pull_request_read_matches_get_pull_request() { + let ctx = default_ctx(); + let _guard = super::backend::cache_repo_visibility_for_tests("github/copilot", true); + let tool_args = json!({ + "owner": "github", + "repo": "copilot", + "pullNumber": 123 + }); + + let expected = apply_tool_labels( + "get_pull_request", + &tool_args, + "github/copilot", + vec![], + vec![], + String::new(), + &ctx, + ); + let actual = apply_tool_labels( + "pull_request_read", + &tool_args, + "github/copilot", + vec![], + vec![], + String::new(), + &ctx, + ); + + assert_eq!(actual, expected); + assert_eq!(actual.2, "pr:github/copilot#123"); + } + #[test] fn test_apply_tool_labels_list_issues_repo_scoped_integrity() { let ctx = default_ctx();