hashes: Feature gate hash_reader unit test

The `hash_reader` function is only available when `bitcoin-io` is
enabled - it should be feature gated.
This commit is contained in:
Tobin C. Harding 2024-08-09 12:11:42 +10:00
parent 5230d3309c
commit 1af6ff4394
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 4 additions and 1 deletions

View File

@ -324,7 +324,7 @@ impl std::error::Error for FromSliceError {}
#[cfg(test)]
mod tests {
use super::*;
use crate::{sha256, sha256d};
use crate::sha256d;
hash_newtype! {
/// A test newtype
@ -351,7 +351,10 @@ mod tests {
}
#[test]
#[cfg(feature = "bitcoin-io")]
fn hash_reader() {
use crate::sha256;
let mut reader: &[u8] = b"hello";
assert_eq!(sha256::Hash::hash_reader(&mut reader).unwrap(), sha256::Hash::hash(b"hello"),)
}