1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! `test-better-matchers`: the `Matcher` trait and standard matchers.
//!
//! A matcher is a reusable, composable expectation. This crate provides:
//!
//! - [`Matcher`], the trait every matcher implements, and its structured
//! result types [`MatchResult`] and [`Mismatch`];
//! - [`Description`], the composable account of what a matcher expects;
//! - the primitive matchers [`eq`], [`ne`], [`lt`], [`le`], [`gt`], [`ge`],
//! [`is_true`], [`is_false`], and the test fixtures [`always_matches`] and
//! [`never_matches`];
//! - the logical combinators [`not`], [`all_of`], and [`any_of`];
//! - the [`Option`]/[`Result`] matchers [`some`], [`none`], [`ok`], and
//! [`err`];
//! - the collection matchers [`have_len`], [`is_empty`], [`is_not_empty`],
//! [`contains`], [`contains_all`], [`contains_in_order`], [`every`], and
//! [`at_least_one`], generic over the [`Sequence`] trait;
//! - the string matchers [`contains_str`], [`starts_with`], [`ends_with`], and
//! (behind the `regex` feature) `matches_regex`;
//! - the numeric matchers [`close_to`], [`between`], [`is_nan`], and
//! [`is_finite`], generic over the sealed [`Float`] trait;
//! - the [`predicate`] escape hatch, a matcher built from an arbitrary
//! named Boolean-returning closure;
//! - the [`define_matcher!`](crate::define_matcher) macro, the declarative
//! shortcut for the common custom-matcher case;
//! - the [`check!`](crate::check) macro and its [`Subject`] type, the entry point for an
//! assertion; when the subject is a [`Future`], the `resolves_to` method
//! awaits it and matches its output, and `completes_within` awaits it
//! under a time limit (the latter behind a runtime feature: `tokio`,
//! `async-std`, or `smol`); `matches_snapshot` compares a
//! [`Display`](std::fmt::Display) value against a file-backed snapshot, and
//! `matches_inline_snapshot` against a snapshot literal in the test source
//! (`test-better-snapshot`); the `*_with` variants of each run a
//! `Redactions` set over the value first, stabilizing non-deterministic
//! content (UUIDs, timestamps) before the comparison;
//! - [`eventually`] and [`eventually_blocking`], which retry a `bool` probe on
//! an exponential [`Backoff`] schedule until it passes or a deadline is hit,
//! replacing `sleep + assert` flakiness;
//! - [`soft`] and its [`SoftAsserter`]/[`SoftScope`], which collect several
//! failures in one test run instead of stopping at the first, with nestable
//! context sub-scopes;
//! - the line-oriented [`diff_lines`] renderer, behind the default `diff`
//! feature.
//!
//! Later iterations add the remaining matcher combinators.
pub use ;
pub use ;
pub use Description;
pub use diff_lines;
pub use ;
pub use ;
pub use ;
pub use ;
pub use predicate;
pub use ;
pub use ;
pub use matches_regex;
pub use ;
pub use Subject;
// Re-exported from `test-better-async`: `Elapsed` and `RuntimeAvailable` appear
// in `Subject::completes_within`'s signature, and the `eventually` family is
// the polling counterpart to the timeout assertion.
pub use ;
// `check!` and `define_matcher!` are `#[macro_export]`, so they already live
// at the crate root.