Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions guards/github-guard/rust-guard/src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,33 @@ mod tests {
}
}

#[test]
fn test_release_issue_comment_and_repository_write_tools_are_write_operations() {
for op in &[
"create_release",
"delete_issue",
"delete_issue_comment",
"delete_release",
"delete_repository",
"edit_release",
"update_issue_comment",
"upload_release_asset",
] {
assert!(
WRITE_OPERATIONS.binary_search(op).is_ok(),
"{op} must be explicitly listed in WRITE_OPERATIONS"
);
assert!(
is_write_operation(op),
"{op} must be classified as a write operation"
);
assert!(
!is_read_write_operation(op),
"{op} should not be in READ_WRITE_OPERATIONS"
);
}
}

#[test]
fn test_is_merge_operation() {
assert!(is_merge_operation("merge_pull_request"));
Expand Down
Loading