pub struct AssertionReport { /* private fields */ }Expand description
Every assertion on one request, evaluated against one response, in a fixed
order: status, status_in, headers, body_contains, body_matches,
elapsed_ms_under, then JSON paths — with the entries of each map in
sorted order — followed by the same order again for the not: block, if
there is one. Deterministic because the output is read by people and
diffed by scripts, and neither is served by an order that depends on how a
BTreeMap happened to be filled.
Implementations§
Source§impl AssertionReport
impl AssertionReport
pub fn results(&self) -> &[AssertionResult]
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
No assertions were written, so nothing was checked.
Distinct from passed, which an empty report also
answers true — vacuously. A front-end prints nothing at all for an
empty report: a request with no assertions must look exactly as it did
before assertions existed.
pub fn len(&self) -> usize
pub fn passed_count(&self) -> usize
pub fn failed_count(&self) -> usize
Sourcepub fn failures(&self) -> impl Iterator<Item = &AssertionResult>
pub fn failures(&self) -> impl Iterator<Item = &AssertionResult>
Just the assertions that did not hold, in evaluation order.
Trait Implementations§
Source§impl Clone for AssertionReport
impl Clone for AssertionReport
Source§fn clone(&self) -> AssertionReport
fn clone(&self) -> AssertionReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AssertionReport
impl Debug for AssertionReport
Source§impl Default for AssertionReport
impl Default for AssertionReport
Source§fn default() -> AssertionReport
fn default() -> AssertionReport
impl Eq for AssertionReport
Source§impl PartialEq for AssertionReport
impl PartialEq for AssertionReport
impl StructuralPartialEq for AssertionReport
Auto Trait Implementations§
impl Freeze for AssertionReport
impl RefUnwindSafe for AssertionReport
impl Send for AssertionReport
impl Sync for AssertionReport
impl Unpin for AssertionReport
impl UnsafeUnpin for AssertionReport
impl UnwindSafe for AssertionReport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.