From cb1c4f76ba8c1a56e752ae7d0e19e2a685535012 Mon Sep 17 00:00:00 2001 From: tibvdm Date: Thu, 4 Apr 2024 02:46:24 +0200 Subject: [PATCH] shuffle in workflows + panic tests --- .github/workflows/coverage.yml | 2 +- .github/workflows/lint.yml | 5 ----- .github/workflows/test.yml | 7 ++++++- fa-compression/src/lib.rs | 18 ++++++++++++++++++ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0cbc36d..a94936f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -4,7 +4,7 @@ name: Coverage jobs: coverage: - name: Coverage + name: Codecov runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 31eeda5..6df8ae4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,11 +18,6 @@ jobs: components: rustfmt, clippy override: true - - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: check - - name: Run cargo fmt uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fd9821..35314fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ name: Test jobs: test: - name: Test + name: Check + test runs-on: ubuntu-latest steps: - name: Checkout repository @@ -17,6 +17,11 @@ jobs: toolchain: nightly override: true + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + - name: Run cargo test uses: actions-rs/cargo@v1 with: diff --git a/fa-compression/src/lib.rs b/fa-compression/src/lib.rs index 939f716..645756c 100644 --- a/fa-compression/src/lib.rs +++ b/fa-compression/src/lib.rs @@ -223,4 +223,22 @@ mod tests { } } } + + #[test] + #[should_panic] + fn test_encode_invalid() { + CharacterSet::encode(b'A'); + } + + #[test] + #[should_panic] + fn test_decode_invalid() { + CharacterSet::decode(15); + } + + #[test] + #[should_panic] + fn test_decode_pair_invalid() { + CharacterSet::decode_pair(0b11111111); + } }