Expand description
see https://github.com/aaronabramov/k9 for high level description of the library
Modules
Macros
Asserts that two passed arguments are equal.
Panics if they’re not, using a pretty printed difference of
Debug representations of the passed arguments.
Asserts if value is Err(E).
panics if it is not
Asserts that the passed
Result
argument is an Err
and
and the debug string of that error matches provided regex.
Regular expressions are compiled using regex
crate.Asserts if left is greater than right.
panics if they are not
Asserts if left greater than or equal to right.
panics if they are not
Asserts if left is lesser than right.
panics if they are not
Asserts if left lesser than or equal to right.
panics if they are not
Asserts that passed
&str
matches a regular expression.
Regular expressions are compiled using regex
crate.Same as snapshot!() macro, but it takes a string as the
only argument and stores the snapshot in a separate file instead of inlining
it in the source code of the test.
Asserts if value is Ok(T).
panics if it is not
Serializes the first argument into a string and compares it with
the second argument, which is a snapshot string that was automatically generated
during previous test runs. Panics if the values are not equal.
Structs
assert_equal! takes a std::fmt::Debug trait object as an argument
which doesn’t work well with multiline strings, since newline characters will be displayed as
\n
For example this string:String with concurrent access. Allows mutation without &mut reference to itself.
It makes passing it to different parts of tests easier when performance is not important.
Useful for accumulating output from a system under test and later using it with
assert_matches_inline_snapshot.