Skip to content

Commit

Permalink
Merge pull request #6 from wcampbell0x2a/use-checkout-v4
Browse files Browse the repository at this point in the history
ci: Add CI and MSRV
  • Loading branch information
wcampbell0x2a committed Sep 11, 2023
2 parents dc1ab9f + ce2214f commit 815f990
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: ci

jobs:
# build, test all supported targets
build-test-stable:
runs-on: ubuntu-latest
strategy:
matrix:
targets:
- x86_64-unknown-linux-musl
toolchain:
- stable
# msrv
- 1.39.0

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.targets }}
- run: cargo test --locked --workspace --target ${{ matrix.targets }}

# fmt and clippy on nightly builds
fmt-clippy-nightly:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: x86_64-unknown-linux-musl
components: rustfmt, clippy
- run: cargo fmt --all --check
- run: cargo clippy --target x86_64-unknown-linux-gnu --workspace -- -D warnings
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ edition = "2018"
repository = "https://github.com/wcampbell0x2a/assert_hex"
description = "display assert panics in hexadecimal {:#x?} format"
license = "MIT"
rust-version = "1.39.0"

[dependencies]
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@

display expression using `{:#x?}` format when false assertion causes `panic!()`.

# why
# 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
# 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.

Expand Down

0 comments on commit 815f990

Please sign in to comment.