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:
parent
5230d3309c
commit
1af6ff4394
|
@ -324,7 +324,7 @@ impl std::error::Error for FromSliceError {}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{sha256, sha256d};
|
use crate::sha256d;
|
||||||
|
|
||||||
hash_newtype! {
|
hash_newtype! {
|
||||||
/// A test newtype
|
/// A test newtype
|
||||||
|
@ -351,7 +351,10 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "bitcoin-io")]
|
||||||
fn hash_reader() {
|
fn hash_reader() {
|
||||||
|
use crate::sha256;
|
||||||
|
|
||||||
let mut reader: &[u8] = b"hello";
|
let mut reader: &[u8] = b"hello";
|
||||||
assert_eq!(sha256::Hash::hash_reader(&mut reader).unwrap(), sha256::Hash::hash(b"hello"),)
|
assert_eq!(sha256::Hash::hash_reader(&mut reader).unwrap(), sha256::Hash::hash(b"hello"),)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue