pub struct FailureDiagnostic {
pub category: &'static str,
pub test_name: &'static str,
pub input_size: usize,
pub input_sample: String,
pub expected_sample: String,
pub actual_sample: String,
pub first_diff_index: Option<usize>,
pub diff_count: usize,
pub error_message: String,
}Expand description
Rich failure diagnostic with context.
Fields§
§category: &'static str§test_name: &'static str§input_size: usize§input_sample: String§expected_sample: String§actual_sample: String§first_diff_index: Option<usize>§diff_count: usize§error_message: StringImplementations§
Source§impl FailureDiagnostic
impl FailureDiagnostic
Sourcepub fn new(
category: &'static str,
test_name: &'static str,
input_size: usize,
error_message: String,
) -> Self
pub fn new( category: &'static str, test_name: &'static str, input_size: usize, error_message: String, ) -> Self
Create a new failure diagnostic.
Sourcepub fn with_input_sample(self, sample: String) -> Self
pub fn with_input_sample(self, sample: String) -> Self
Add input sample (first N elements).
Trait Implementations§
Source§impl Clone for FailureDiagnostic
impl Clone for FailureDiagnostic
Source§fn clone(&self) -> FailureDiagnostic
fn clone(&self) -> FailureDiagnostic
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FailureDiagnostic
impl RefUnwindSafe for FailureDiagnostic
impl Send for FailureDiagnostic
impl Sync for FailureDiagnostic
impl Unpin for FailureDiagnostic
impl UnsafeUnpin for FailureDiagnostic
impl UnwindSafe for FailureDiagnostic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more