Skip to content

v0.6.2

Choose a tag to compare

@lpotthast lpotthast released this 20 Aug 21:07
· 34 commits to main since this release

Added

  • Iterator assertions now provide equality, predicate (_matching), and nested assertion (_satisfying) variants for
    membership, negative membership, prefixes, suffixes, contiguous subsequences, positional exact matches, and
    unordered exact matches. The same API is available as chainable into_iter_* assertions over fresh borrowed
    iteration, together with into_iter_is_empty, into_iter_is_not_empty, and into_iter_has_length.
  • Added chainable, non-consuming ExactSizeIteratorAssertions: has_remaining_count,
    has_no_remaining_elements, and has_remaining_elements, including their fluent have_remaining_* aliases.

Deprecated

  • into_iter_iterator_is_empty was renamed to into_iter_is_empty. The old name remains as a forwarding alias.

Fixed

  • Iterator membership, prefix, contiguous-subsequence, and exact-match assertions now stream and short-circuit instead
    of eagerly collecting arbitrary iterators. Exact assertions consume or buffer at most expected.len() + 1 elements,
    diagnostics retain a bounded 16-element tail preview, and unavoidable nontermination for never-deciding potentially
    unbounded iterators is documented.
  • Chainable into_iter_* assertions now create exactly one borrowed iterator per assertion, including for diagnostics,
    and into_iter_contains_exactly no longer requires the redundant T: PartialEq<E> bound.
  • In capture mode, diagnostic detail messages generated by a failed assertion no longer reappear in the failure
    messages of later assertions on the same chain. This affected every assertion attaching diagnostics such as the
    Differences: ... of is_equal_to, the element diagnostics of the collection assertions, and the HashMap, path,
    and numeric assertions. Assertion internals now pass such diagnostics directly into the raised failure instead of
    storing them on the assertion context, making the leak impossible by construction. Messages added via
    with_detail_message / add_detail_message are unaffected and still apply to every subsequent failure.