8 unstable releases (3 breaking)
0.4.1 | Sep 17, 2023 |
---|---|
0.4.0 | Sep 11, 2023 |
0.3.0 | Aug 30, 2023 |
0.2.2 | Jan 30, 2021 |
0.1.0 | Mar 9, 2020 |
2,525 downloads per month
Used in 14 crates
7KB
118 lines
assert_hex
display expression using {:#x?}
format when false assertion causes panic!()
.
Why
Writing and testing protocol level libraries requires many tests to be written
with respect to byte level protocol sections in hex. This library simplifies the process
of viewing the differences between these types when tests fail by displaying by using the
{:#x?}
representation.
Usage
Compiler support: requires rustc 1.39+
$ cargo add assert_hex
Replace assert_eq
or assert_ne
with assert_eq_hex
or assert_ne_hex
respectively.
Changelog
See CHANGELOG.md
lib.rs
:
assert_hex
display expression using {:#x?}
format when false assertion causes panic!()
.
why
Writing and testing protocol level libraries requires many tests to be written
with respect to byte level protocol sections in hex. This library simplifies the process
of viewing the differences between these types when tests fail by displaying by using the
{:#x?}
representation.
usage
Replace assert_eq
or assert_ne
with assert_eq_hex
or assert_ne_hex
respectively.