Shorthand for differential fuzzing results (#526)
* Shorthand for differential fuzzing results * must_use
This commit is contained in:
parent
914bcd5c47
commit
a3345902c2
@ -28,6 +28,23 @@ pub enum DiffResult {
|
|||||||
Diff,
|
Diff,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl DiffResult {
|
||||||
|
/// Returns `true` if the two observers report the same outcome.
|
||||||
|
#[must_use]
|
||||||
|
pub fn is_equal(&self) -> bool {
|
||||||
|
match self {
|
||||||
|
DiffResult::Equal => true,
|
||||||
|
DiffResult::Diff => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns `true` if the two observers report different outcomes.
|
||||||
|
#[must_use]
|
||||||
|
pub fn is_diff(&self) -> bool {
|
||||||
|
!self.is_equal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A [`DiffFeedback`] compares the content of two [`Observer`]s using the given compare function.
|
/// A [`DiffFeedback`] compares the content of two [`Observer`]s using the given compare function.
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct DiffFeedback<F, O1, O2>
|
pub struct DiffFeedback<F, O1, O2>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user