pub trait GroupRunEventByTestCase: Iterator<Item = RunEvent> + Sized {
// Provided methods
fn group_by_test_case_ordered(
self,
) -> LinkedHashMap<Option<String>, GroupedRunEvents> { ... }
fn group_by_test_case_unordered(
self,
) -> HashMap<Option<String>, GroupedRunEvents> { ... }
fn group(self) -> GroupedRunEvents { ... }
}
Expand description
Trait allowing iterators over RunEvent
to be partitioned by test case name.
Provided Methods§
Sourcefn group_by_test_case_ordered(
self,
) -> LinkedHashMap<Option<String>, GroupedRunEvents>
fn group_by_test_case_ordered( self, ) -> LinkedHashMap<Option<String>, GroupedRunEvents>
Groups the RunEvent
s by test case name into a map that preserves insertion order of
various types of events.
The overall order of test cases (by first event) and the orders of events within each test
case are preserved, but events from different test cases are effectively de-interleaved.
Example:
use test_diagnostics::{RunEvent, GroupRunEventByTestCase as _};
use linked_hash_map::LinkedHashMap;
let events: Vec<RunEvent> = get_events();
let grouped: LinkedHashMap<Option<String>, GroupedRunEvents> =
events.into_iter().group_by_test_case_ordered();
Sourcefn group_by_test_case_unordered(
self,
) -> HashMap<Option<String>, GroupedRunEvents>
fn group_by_test_case_unordered( self, ) -> HashMap<Option<String>, GroupedRunEvents>
Groups the RunEvent
s by test case name into an unordered map. The orders of events within
each test case are preserved, but the test cases themselves are not in a defined order.
Sourcefn group(self) -> GroupedRunEvents
fn group(self) -> GroupedRunEvents
Group RunEvent
s by stdout, stderr and non-stdout/err events and returns GroupedRunEvents
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.