Add missing hex feature gate
`hex` was previously enabled by `alloc`, now it is optional add the missing feature gate to tests.
This commit is contained in:
parent
fce0cf1692
commit
e7c6564d38
|
@ -95,6 +95,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[cfg(bench)]
|
||||
#[cfg(feature = "hex")]
|
||||
mod benches {
|
||||
use test::Bencher;
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ impl crate::HashEngine for HashEngine {
|
|||
mod tests {
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn test() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
|
|
@ -107,6 +107,7 @@ where
|
|||
|
||||
#[cfg(test)]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
mod tests {
|
||||
use hex::prelude::{DisplayHex, FromHex};
|
||||
|
||||
|
|
|
@ -326,6 +326,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn newtype_fmt_roundtrip() {
|
||||
use alloc::format;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn test() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn test() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ use crate::{sha256, HashEngine};
|
|||
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn test() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
@ -70,6 +71,7 @@ fn test() {
|
|||
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn fmt_roundtrips() {
|
||||
use alloc::format;
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn test() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
@ -98,6 +99,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn fmt_roundtrips() {
|
||||
use alloc::format;
|
||||
|
||||
|
|
|
@ -182,10 +182,12 @@ mod tests {
|
|||
|
||||
// The digest created by sha256 hashing `&[0]` starting with `TEST_MIDSTATE`.
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
const HASH_ZERO_BACKWARD: &str =
|
||||
"29589d5122ec666ab5b4695070b6debc63881a4f85d88d93ddc90078038213ed";
|
||||
// And the same thing, forward.
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
const HASH_ZERO_FORWARD: &str =
|
||||
"ed1382037800c9dd938dd8854f1a8863bcdeb6705069b4b56a66ec22519d5829";
|
||||
|
||||
|
@ -198,10 +200,12 @@ mod tests {
|
|||
|
||||
// We support manually implementing `Tag` and creating a tagged hash from it.
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
pub type TestHash = sha256t::Hash<TestHashTag>;
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn manually_created_sha256t_hash_type() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ impl crate::HashEngine for HashEngine {
|
|||
mod tests {
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn test() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn test() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ impl crate::HashEngine for HashEngine {
|
|||
mod tests {
|
||||
#[test]
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg(feature = "hex")]
|
||||
fn test() {
|
||||
use alloc::string::ToString;
|
||||
|
||||
|
|
Loading…
Reference in New Issue