hive-matrix-mcp: cover send_redact reason=None in round-trip test (argus note)
This commit is contained in:
parent
1c0f7a72f7
commit
55ba30aa18
1 changed files with 19 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue