use `hash.to_byte_array` to check equality with `test.output`
Tests in 'hashes' used various ways to do this that looked different but did the same.
This commit is contained in:
parent
969864e3b0
commit
55749d6f61
|
@ -98,7 +98,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
let manual_hash = Hash::from_engine(engine);
|
let manual_hash = Hash::from_engine(engine);
|
||||||
assert_eq!(hash, manual_hash);
|
assert_eq!(hash, manual_hash);
|
||||||
assert_eq!(hash.to_byte_array()[..].as_ref(), test.output.as_slice());
|
assert_eq!(hash.to_byte_array(), test.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -489,7 +489,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
let manual_hash = ripemd160::Hash::from_engine(engine);
|
let manual_hash = ripemd160::Hash::from_engine(engine);
|
||||||
assert_eq!(hash, manual_hash);
|
assert_eq!(hash, manual_hash);
|
||||||
assert_eq!(hash.as_byte_array(), test.output.as_slice());
|
assert_eq!(hash.to_byte_array(), test.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
let manual_hash = sha1::Hash::from_engine(engine);
|
let manual_hash = sha1::Hash::from_engine(engine);
|
||||||
assert_eq!(hash, manual_hash);
|
assert_eq!(hash, manual_hash);
|
||||||
assert_eq!(hash.as_byte_array(), test.output.as_slice());
|
assert_eq!(hash.to_byte_array(), test.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -926,7 +926,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
let manual_hash = sha256::Hash::from_engine(engine);
|
let manual_hash = sha256::Hash::from_engine(engine);
|
||||||
assert_eq!(hash, manual_hash);
|
assert_eq!(hash, manual_hash);
|
||||||
assert_eq!(hash.to_byte_array()[..].as_ref(), test.output.as_slice());
|
assert_eq!(hash.to_byte_array(), test.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ mod tests {
|
||||||
let sha2d_hash = sha2_hash.hash_again();
|
let sha2d_hash = sha2_hash.hash_again();
|
||||||
assert_eq!(hash, sha2d_hash);
|
assert_eq!(hash, sha2d_hash);
|
||||||
|
|
||||||
assert_eq!(hash.to_byte_array()[..].as_ref(), test.output.as_slice());
|
assert_eq!(hash.to_byte_array(), test.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
let manual_hash = sha384::Hash::from_engine(engine);
|
let manual_hash = sha384::Hash::from_engine(engine);
|
||||||
assert_eq!(hash, manual_hash);
|
assert_eq!(hash, manual_hash);
|
||||||
assert_eq!(hash.to_byte_array()[..].as_ref(), test.output.as_slice());
|
assert_eq!(hash.to_byte_array(), test.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -380,7 +380,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
let manual_hash = sha512::Hash::from_engine(engine);
|
let manual_hash = sha512::Hash::from_engine(engine);
|
||||||
assert_eq!(hash, manual_hash);
|
assert_eq!(hash, manual_hash);
|
||||||
assert_eq!(hash.to_byte_array()[..].as_ref(), test.output.as_slice());
|
assert_eq!(hash.to_byte_array(), test.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
let manual_hash = sha512_256::Hash::from_engine(engine);
|
let manual_hash = sha512_256::Hash::from_engine(engine);
|
||||||
assert_eq!(hash, manual_hash);
|
assert_eq!(hash, manual_hash);
|
||||||
assert_eq!(hash.to_byte_array()[..].as_ref(), test.output.as_slice());
|
assert_eq!(hash.to_byte_array(), test.output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue