pub enum ExpectationMatcher {
ToBe(Expr),
ToEqual(Expr),
ToBeCloseTo {
expected: Expr,
tolerance: Option<f64>,
},
ToBeGreaterThan(Expr),
ToBeLessThan(Expr),
ToContain(Expr),
ToBeTruthy,
ToBeFalsy,
ToThrow(Option<String>),
ToMatchPattern {
pattern: String,
options: TestMatchOptions,
},
}Expand description
Expectation matchers for expect statements
Variants§
ToBe(Expr)
Expect value to be exactly equal
ToEqual(Expr)
Expect value to equal (with deep equality)
ToBeCloseTo
Expect numeric value to be close to target
ToBeGreaterThan(Expr)
Expect value to be greater than
ToBeLessThan(Expr)
Expect value to be less than
ToContain(Expr)
Expect collection to contain element
ToBeTruthy
Expect value to be truthy
ToBeFalsy
Expect value to be falsy
ToThrow(Option<String>)
Expect function to throw error
ToMatchPattern
Expect rows to match pattern
Trait Implementations§
Source§impl Clone for ExpectationMatcher
impl Clone for ExpectationMatcher
Source§fn clone(&self) -> ExpectationMatcher
fn clone(&self) -> ExpectationMatcher
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 moreSource§impl Debug for ExpectationMatcher
impl Debug for ExpectationMatcher
Source§impl<'de> Deserialize<'de> for ExpectationMatcher
impl<'de> Deserialize<'de> for ExpectationMatcher
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ExpectationMatcher
impl RefUnwindSafe for ExpectationMatcher
impl Send for ExpectationMatcher
impl Sync for ExpectationMatcher
impl Unpin for ExpectationMatcher
impl UnsafeUnpin for ExpectationMatcher
impl UnwindSafe for ExpectationMatcher
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