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:
parent
3344cf6be2
commit
5e3abc5e11
|
@ -204,13 +204,12 @@ impl_fromhex_array!(384);
|
||||||
impl_fromhex_array!(512);
|
impl_fromhex_array!(512);
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
|
||||||
use internals::hex::exts::DisplayHex;
|
use internals::hex::exts::DisplayHex;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
|
||||||
fn hex_roundtrip() {
|
fn hex_roundtrip() {
|
||||||
let expected = "0123456789abcdef";
|
let expected = "0123456789abcdef";
|
||||||
let expected_up = "0123456789ABCDEF";
|
let expected_up = "0123456789ABCDEF";
|
||||||
|
@ -232,7 +231,6 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
|
||||||
fn hex_error() {
|
fn hex_error() {
|
||||||
let oddlen = "0123456789abcdef0";
|
let oddlen = "0123456789abcdef0";
|
||||||
let badchar1 = "Z123456789abcdef";
|
let badchar1 = "Z123456789abcdef";
|
||||||
|
|
|
@ -43,12 +43,10 @@ fn from_engine(e: sha256::HashEngine) -> Hash {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::sha256;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
fn test() {
|
fn test() {
|
||||||
use crate::{sha256d, Hash, HashEngine};
|
use crate::{sha256, sha256d, Hash, HashEngine};
|
||||||
use crate::hex::FromHex;
|
use crate::hex::FromHex;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
Loading…
Reference in New Issue