Add regression test for issue 523

This commit is contained in:
Maybe Waffle 2022-02-13 20:53:58 +03:00
parent fb523f153e
commit c0795f0dc9

View file

@ -492,4 +492,25 @@ mod test {
_ => panic!("Expected error"),
}
}
#[test]
fn issue_523() {
let json = r#"{
"update_id":0,
"my_chat_member": {
"chat":{"id":0,"first_name":"FN","last_name":"LN","username":"UN","type":"private"},
"from":{"id":0,"is_bot":false,"first_name":"FN","last_name":"LN","username":"UN"},
"date":1644677726,
"old_chat_member":{"user":{"id":1,"is_bot":true,"first_name":"bot","username":"unBot"},"status":"member"},
"new_chat_member":{"user":{"id":1,"is_bot":true,"first_name":"bot","username":"unBot"},"status":"kicked","until_date":0}
}
}"#;
let Update { kind, .. } = serde_json::from_str(json).unwrap();
match kind {
UpdateKind::MyChatMember(_) => {}
_ => panic!("Expected `MyChatMember`"),
}
}
}