Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wcampbell0x2a/assert_hex
Rust library to display assert panics in hexadecimal format
https://github.com/wcampbell0x2a/assert_hex
assert hex rust
Last synced: 4 days ago
JSON representation
Rust library to display assert panics in hexadecimal format
- Host: GitHub
- URL: https://github.com/wcampbell0x2a/assert_hex
- Owner: wcampbell0x2a
- License: mit
- Created: 2020-03-09T20:34:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-17T14:49:13.000Z (over 1 year ago)
- Last Synced: 2024-11-15T18:33:20.436Z (2 months ago)
- Topics: assert, hex, rust
- Language: Rust
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# assert_hex
[![Latest Version](https://img.shields.io/crates/v/assert_hex.svg)](https://crates.io/crates/assert_hex)
[![Rust Documentation](https://docs.rs/assert_hex/badge.svg)](https://docs.rs/assert_hex)
[![Crates.io](https://img.shields.io/crates/d/assert_hex)](https://crates.io/crates/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](https://github.com/wcampbell0x2a/assert_hex/blob/master/CHANGELOG.md)