Expand description
Definitions of the assertions that are provided by this crate.
Assertions define the methods that are used to assert that the actual test result is as expected. Assertions are defined by traits that are implemented for one or several types. An assertion can be applied to all types that implement this assertion.
All assertions provided by this crate are defined in this module. Browse over the traits in this module to get information about all provided assertions.
Traitsยง
- Assert
Boolean - Assert whether some value or expression is true or false.
- Assert
Borrowed Option Value - Assert the value of a borrowed option by mapping the subject.
- Assert
Borrowed Result Value - Assert the ok-value or error of a borrowed result by mapping the subject.
- Assert
Char - Assert properties or classifications of a character.
- Assert
Code Panics panic
- Assert that the code under test panics, panics with a certain message or does not panic.
- Assert
Decimal Number - Assert decimal number specific properties.
- Assert
Emptiness - Assert whether a string, collection or iterator is empty or not.
- Assert
Equality - Assert whether two values are equal or not.
- Assert
Error HasSource - Assert the source of any type that implements
std::error::Error
. - Assert
HasChar Count - Assert the number of characters contained in a string or similar container.
- Assert
HasDebug Message - Assert a type formatted into a debug string.
- Assert
HasDisplay Message - Assert a type formatted into a display string.
- Assert
HasError - Assert that a subject of some container type holds an error value that is equal to the expected one.
- Assert
HasError Message - Assert that a subject of some container type holds an error value that has a message equal to the expected message.
- Assert
HasLength - Assert the length of a subject.
- Assert
HasValue - Assert that a subject of some container type holds a value that is equal to the expected one.
- Assert
InRange - Assert whether a value is within an expected range.
- Assert
Infinity - Assert whether a numeric value is infinite or finite.
- Assert
IsClose ToWith Default Margin float-cmp
- Assert approximate equality for floating point numbers.
- Assert
IsClose ToWithin Margin float-cmp
- Assert approximate equality for floating point numbers.
- Assert
IsSorted - Assert the order of the values within a collection.
- Assert
Iterator Contains - Assert that an iterator or collection contains the expected value.
- Assert
Iterator Contains InAny Order - Assert values in a collection.
- Assert
Iterator Contains InOrder - Assert values in an ordered collection.
- Assert
MapContains Key - Assertions for the keys of a map.
- Assert
MapContains Value - Assertions for the values of a map.
- Assert
NotA Number - Assert whether a numeric value is not a number.
- Assert
Numeric Identity - Assert the additive and multiplicative identity of a number.
- Assert
Option - Assert whether a subject of the
Option
type holds some value or has none. - Assert
Option Value - Assert the value of an option by mapping the subject.
- Assert
Order - Assert whether a value is greater than or less than another value, as well as at most as big or at least as big as another value.
- Assert
Result - Assert whether a subject of the
Result
type holds some value or an error. - Assert
Result Value - Assert the ok-value or error of a result by mapping the subject.
- Assert
Signum - Assert whether a numeric value is negative or positive.
- Assert
String Contains AnyOf - Assert that a string contains any char from a collection of chars.
- Assert
String Matches regex
- Assert that a string matches a regex pattern.
- Assert
String Pattern - Assert that a string contains a substring or character.