File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -10929,7 +10929,18 @@ where
10929
10929
let events = core::cell::RefCell::new(Vec::new());
10930
10930
let event_handler = |event: events::Event| Ok(events.borrow_mut().push(event));
10931
10931
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
10933
10944
}
10934
10945
10935
10946
#[cfg(feature = "_test_utils")]
You can’t perform that action at this time.
0 commit comments