Fix feature gating on unit tests

Currently we have incorrect feature gating on unit tests and imports
leading to unused import warnings.
This commit is contained in:
Tobin C. Harding 2023-01-20 16:43:23 +11:00
parent 3344cf6be2
commit 5e3abc5e11
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 2 additions and 6 deletions

View File

@ -204,13 +204,12 @@ impl_fromhex_array!(384);
impl_fromhex_array!(512);
#[cfg(test)]
#[cfg(any(feature = "std", feature = "alloc"))]
mod tests {
use super::*;
#[cfg(any(feature = "std", feature = "alloc"))]
use internals::hex::exts::DisplayHex;
#[test]
#[cfg(any(feature = "std", feature = "alloc"))]
fn hex_roundtrip() {
let expected = "0123456789abcdef";
let expected_up = "0123456789ABCDEF";
@ -232,7 +231,6 @@ mod tests {
}
#[test]
#[cfg(any(feature = "std", feature = "alloc"))]
fn hex_error() {
let oddlen = "0123456789abcdef0";
let badchar1 = "Z123456789abcdef";

View File

@ -43,12 +43,10 @@ fn from_engine(e: sha256::HashEngine) -> Hash {
#[cfg(test)]
mod tests {
use crate::sha256;
#[test]
#[cfg(any(feature = "std", feature = "alloc"))]
fn test() {
use crate::{sha256d, Hash, HashEngine};
use crate::{sha256, sha256d, Hash, HashEngine};
use crate::hex::FromHex;
#[derive(Clone)]