Import with super::* in unit test
As is customary import using a wildcard. Includes `use Hash as _` to remove naming conflict between the trait and type.
This commit is contained in:
parent
f69417f8bc
commit
e302e30e7c
|
@ -817,7 +817,8 @@ impl HashEngine {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{sha256, Hash, HashEngine};
|
use crate::{sha256, Hash as _, HashEngine};
|
||||||
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
|
@ -964,14 +965,14 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn const_hash() {
|
fn const_hash() {
|
||||||
assert_eq!(super::Hash::hash(&[]), super::Hash::const_hash(&[]));
|
assert_eq!(Hash::hash(&[]), Hash::const_hash(&[]));
|
||||||
|
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::new();
|
||||||
for i in 0..256 {
|
for i in 0..256 {
|
||||||
bytes.push(i as u8);
|
bytes.push(i as u8);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
super::Hash::hash(&bytes),
|
Hash::hash(&bytes),
|
||||||
super::Hash::const_hash(&bytes),
|
Hash::const_hash(&bytes),
|
||||||
"hashes don't match for length {}",
|
"hashes don't match for length {}",
|
||||||
i + 1
|
i + 1
|
||||||
);
|
);
|
||||||
|
@ -980,8 +981,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn const_midstate() {
|
fn const_midstate() {
|
||||||
use super::Midstate;
|
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Midstate::hash_tag(b"TapLeaf"),
|
Midstate::hash_tag(b"TapLeaf"),
|
||||||
Midstate([
|
Midstate([
|
||||||
|
|
Loading…
Reference in New Issue