Macro writeable::assert_try_writeable_eq
source ยท macro_rules! assert_try_writeable_eq { ($actual_writeable:expr, $expected_str:expr $(,)?) => { ... }; ($actual_writeable:expr, $expected_str:expr, $expected_result:expr $(,)?) => { ... }; ($actual_writeable:expr, $expected_str:expr, $expected_result:expr, $($arg:tt)+) => { ... }; (@internal, $actual_writeable:expr, $expected_str:expr, $expected_result:expr, $($arg:tt)+) => { ... }; }
Expand description
Testing macros for types implementing TryWriteable
.
Arguments, in order:
- The
TryWriteable
under test - The expected string value
- The expected result value, or
Ok(())
if omitted *_parts_eq
only: a list of parts ([(start, end, Part)]
)
Any remaining arguments get passed to format!
The macros tests the following:
- Equality of string content
- Equality of parts (
*_parts_eq
only) - Validity of size hint
- Reflexivity of
cmp_bytes
and order against largest and smallest strings
For a usage example, see TryWriteable
.