- assert_eq!(msg_events.len(), if with_error_msg { 2 } else { 1 });
- match msg_events[0] {
- MessageSendEvent::BroadcastChannelUpdate { ref msg } => {
- assert_eq!(msg.contents.flags & 2, 2);
- },
- _ => panic!("Unexpected event"),
- }
- if with_error_msg {
- match msg_events[1] {
+ assert_eq!(msg_events.len(), if with_error_msg { num_channels * 2 } else { num_channels });
+ msg_events.into_iter().filter_map(|msg_event| {
+ match msg_event {
+ MessageSendEvent::BroadcastChannelUpdate { ref msg } => {
+ assert_eq!(msg.contents.flags & 2, 2);
+ None
+ },