Add hash_again regression test

Add a simple regression test prior to patching the
`sha256::Hash::hash_again` function.
This commit is contained in:
Tobin C. Harding 2025-02-20 13:38:22 +11:00
parent d96d0f72b5
commit 84623ffaf9
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 10 additions and 0 deletions

View File

@ -87,3 +87,13 @@ fn regression_siphash24_with_key() {
let want = "e823ed82311d601a";
assert_eq!(got, want);
}
#[test]
fn regression_sha256_hash_again() {
let hash = sha256::Hash::hash(b"Don't explain your philosophy. Embody it.");
let again = hash.hash_again();
let got = format!("{}", again);
let want = "28273103bcd88ab99e2b1007174770ff3f0ea91ee4b3ac942879ed1a2d264b4c";
assert_eq!(got, want);
}