Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(relay): extract mutation type alias in params tests

Steven Enamakelf32d4e5e9f9d
diff --git a/crates/openhuman-core/src/channels/providers/relay/params_tests.rs b/crates/openhuman-core/src/channels/providers/relay/params_tests.rs
index a800d4cc85..7ad215132c 100644
--- a/crates/openhuman-core/src/channels/providers/relay/params_tests.rs
+++ b/crates/openhuman-core/src/channels/providers/relay/params_tests.rs
@@ -93,9 +93,12 @@ fn ids_cannot_forge_another_chats_thread() {
}
}
+/// A change that breaks one field of a valid message.
+type Mutation = Box<dyn Fn(&mut RelayInboundParams)>;
+
#[test]
fn every_field_is_checked() {
- let cases: Vec<(&str, Box<dyn Fn(&mut RelayInboundParams)>)> = vec![
+ let cases: Vec<(&str, Mutation)> = vec![
("channel", Box::new(|p| p.channel = "Web".into())),
("chat_id", Box::new(|p| p.chat_id = "a/b".into())),
("sender_id", Box::new(|p| p.sender_id = String::new())),