diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4668f56..654df9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,6 +36,10 @@ jobs: run: cargo clippy --all-targets --all-features -- -D warnings shell: bash + - name: Test --no-default-features + run: cargo test --no-default-features + shell: bash + - name: Test run: cargo test --all-features shell: bash diff --git a/tests/lib.rs b/tests/lib.rs index 6456253..212aa62 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] -extern crate alloc; + #[cfg(feature = "std")] mod std_tests { use std::collections::HashMap; @@ -215,14 +215,13 @@ mod std_tests { #[cfg(all(test, not(feature = "std")))] mod no_std_tests { - use alloc::vec; use cid::Cid; #[test] fn validate_cid_unwrap_panics() { // This should not panic, but should return an error. // bad_cid created during fuzz testing - let bad_cid = vec![255, 255, 255, 255, 0, 6, 85, 0]; - assert_eq!(Cid::read_bytes(&bad_cid[..]).is_ok(), false); + let bad_cid = [255, 255, 255, 255, 0, 6, 85, 0]; + assert!(Cid::read_bytes(&bad_cid[..]).is_err()); } }