Expand description
Modules§
- core
- Core types for the library.
- docs
docsrs
- User Docs
- format
- The formatters provided by this crate.
- matchers
- The matchers provided by this crate.
Macros§
- expect
- Make an assertion.
- fields
- Apply matchers to multiple struct fields.
- pattern
- Construct a new
Pattern
value from amatch
pattern.
Structs§
- Error
- An error that occurs in a matcher.
Functions§
- all
- Succeeds when all of the passed matchers succeed.
- any
- Succeeds when any of the passed matchers succeed.
- approx_
eq_ f32 float
- Succeeds when the actual
f32
value approximately equals the expectedf32
value. - approx_
eq_ f64 float
- Succeeds when the actual
f64
value approximately equals the expectedf64
value. - approx_
eq_ time - Succeeds when the actual time approximately equals the expected time.
- be_
default - Succeeds when the actual value equals the default value for the type.
- be_
directory - Succeeds when the actual value is the path of an existing directory.
- be_
empty - Succeeds when the actual value is empty.
- be_err
- Succeeds when the actual value is
Err
. - be_
existing_ file - Succeeds when the actual value is the path of an existing file.
- be_
false - Succeeds when the actual value is
false
. - be_ge
- Succeeds when the actual value is greater than or equal to the expected value.
- be_gt
- Succeeds when the actual value is greater than the expected value.
- be_in
- Succeeds when the actual value is contained in the expected collection.
- be_le
- Succeeds when the actual value is less than or equal to the expected value.
- be_lt
- Succeeds when the actual value is less than the expected value.
- be_none
- Succeeds when the actual value is
None
. - be_ok
- Succeeds when the actual value is
Ok
. - be_
regular_ file - Succeeds when the actual value is the path of an existing regular file.
- be_some
- Succeeds when the actual value is
Some
. - be_
sorted_ asc - Succeeds when the actual value is sorted in ascending order.
- be_
sorted_ by - Succeeds when the actual value is sorted according to the given predicate.
- be_
sorted_ desc - Succeeds when the actual value is sorted in descending order.
- be_
symlink - Succeeds when the actual value is the path of an existing symbolic link.
- be_true
- Succeeds when the actual value is
true
. - be_zero
- Succeeds when the actual integer value is
0
. - consist_
of - Succeeds when the actual value contains exactly the given elements, in any order.
- contain_
element - Succeeds when the actual value contains the given element.
- contain_
elements - Succeeds when the actual value contains all the given elements.
- contain_
substr - Succeeds when the actual value contains the expected substring.
- each
- Succeeds when each of the passed matchers succeeds.
- eq_
casefold casefold
- Succeeds when the actual string equals the expected string regardless of case.
- eq_diff
diff
- Succeeds when the actual value equals the expected value and shows a diff otherwise.
- equal
- Succeeds when the actual value equals the expected value.
- every
- Succeeds when the matcher succeeds for every element of the actual value.
- have_
len - Succeeds when the actual value has the given length.
- have_
prefix - Succeeds when the actual value has the expected prefix.
- have_
suffix - Succeeds when the actual value has the expected suffix.
- into
- Infallibly convert the input value via
From
/Into
. - iter_
map - Infallibly map each value of an iterator by applying a function to it.
- iter_
try_ map - Fallibly map each value of an iterator by applying a function to it.
- map
- Infallibly map the input value by applying a function to it.
- match_
any_ fields - Succeeds when any of the fields of a struct succeed.
- match_
elements - Tests each element of the actual value against a different matcher.
- match_
fields - Succeeds when all the fields of a struct succeed.
- match_
json json
- Succeeds when the actual string and the expected string are equivalent JSON.
- match_
pattern - Succeeds when the given pattern matches.
- match_
regex regex
- Succeeds when the actual value matches the given regular expression.
- not
- Negates the matcher passed to it.
- try_
into - Fallibly convert the input value via
TryFrom
/TryInto
. - try_map
- Fallibly map the input value by applying a function to it.
- why
- Attaches a context string to a matcher that will appear in the failure output.
- why_
lazy - Attaches a lazily evaluated context string to a matcher that will appear in the failure output.