File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -10929,7 +10929,18 @@ where
1092910929 let events = core::cell::RefCell::new(Vec::new());
1093010930 let event_handler = |event: events::Event| Ok(events.borrow_mut().push(event));
1093110931 self.process_pending_events(&event_handler);
10932- events.into_inner()
10932+ let collected_events = events.into_inner();
10933+
10934+ // To expand the coverage and make sure all events are properly serialised and deserialised,
10935+ // we test all generated events round-trip:
10936+ for event in &collected_events {
10937+ let ser = event.encode();
10938+ if let Some(deser) = events::Event::read(&mut &ser[..]).expect("event should deserialize") {
10939+ assert_eq!(&deser, event, "event should roundtrip correctly");
10940+ }
10941+ }
10942+
10943+ collected_events
1093310944 }
1093410945
1093510946 #[cfg(feature = "_test_utils")]
You can’t perform that action at this time.
0 commit comments