Struct googletest::matchers::ContainsMatcher
source · pub struct ContainsMatcher<T, InnerMatcherT> { /* private fields */ }
Expand description
A matcher which matches a container containing one or more elements a given
inner Matcher
matches.
Implementations§
source§impl<T, InnerMatcherT> ContainsMatcher<T, InnerMatcherT>
impl<T, InnerMatcherT> ContainsMatcher<T, InnerMatcherT>
sourcepub fn times(self, count: impl Matcher<ActualT = usize> + 'static) -> Self
pub fn times(self, count: impl Matcher<ActualT = usize> + 'static) -> Self
Configures this instance to match containers which contain a number of
matching items matched by count
.
For example, to assert that exactly three matching items must be present, use:
ⓘ
contains(...).times(eq(3))
One can also use times(eq(0))
to test for the absence of an item
matching the expected value.
Trait Implementations§
source§impl<T: Debug, InnerMatcherT: Matcher<ActualT = T>, ContainerT: Debug> Matcher for ContainsMatcher<ContainerT, InnerMatcherT>
impl<T: Debug, InnerMatcherT: Matcher<ActualT = T>, ContainerT: Debug> Matcher for ContainsMatcher<ContainerT, InnerMatcherT>
source§fn matches(&self, actual: &Self::ActualT) -> MatcherResult
fn matches(&self, actual: &Self::ActualT) -> MatcherResult
Returns whether the condition matches the datum
actual
. Read moresource§fn explain_match(&self, actual: &Self::ActualT) -> Description
fn explain_match(&self, actual: &Self::ActualT) -> Description
source§fn describe(&self, matcher_result: MatcherResult) -> Description
fn describe(&self, matcher_result: MatcherResult) -> Description
Returns a description of
self
or a negative description if
matcher_result
is DoesNotMatch
. Read moreAuto Trait Implementations§
impl<T, InnerMatcherT> !RefUnwindSafe for ContainsMatcher<T, InnerMatcherT>
impl<T, InnerMatcherT> !Send for ContainsMatcher<T, InnerMatcherT>
impl<T, InnerMatcherT> !Sync for ContainsMatcher<T, InnerMatcherT>
impl<T, InnerMatcherT> Unpin for ContainsMatcher<T, InnerMatcherT>
impl<T, InnerMatcherT> !UnwindSafe for ContainsMatcher<T, InnerMatcherT>
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