hive-matrix-mcp: cover send_redact reason=None in round-trip test (argus note)

This commit is contained in:
damocles 2026-06-16 11:03:53 +02:00
commit 55ba30aa18

View file

@ -280,7 +280,7 @@ mod tests {
}
#[test]
fn send_redact_round_trips_with_optional_reason() {
fn send_redact_round_trips_with_reason() {
let req = DaemonRequest {
account: None,
op: DaemonOp::SendRedact {
@ -306,6 +306,24 @@ mod tests {
}
}
#[test]
fn send_redact_round_trips_without_reason() {
let req = DaemonRequest {
account: None,
op: DaemonOp::SendRedact {
room: "!r:s".to_owned(),
event_id: "$e".to_owned(),
reason: None,
},
};
let line = serde_json::to_string(&req).unwrap();
let back: DaemonRequest = serde_json::from_str(&line).unwrap();
match back.op {
DaemonOp::SendRedact { reason, .. } => assert_eq!(reason, None),
other => panic!("wrong variant: {other:?}"),
}
}
#[test]
fn unit_variant_op_parses_inside_envelope() {
// A bare op with no fields still parses when wrapped.