test: add some test

This commit is contained in:
2026-03-26 12:57:14 +01:00
parent 60f81f6d4e
commit eddb3acacd

View File

@@ -62,4 +62,24 @@ pub mod shasum {
out
}
#[cfg(test)]
mod test {
use crate::utils::shasum::sha256sum_to_hex_string;
#[test]
fn sha256sum_string() {
let null_sha = sha256sum_to_hex_string(&[0; 32]);
let full_sha = sha256sum_to_hex_string(&[0xff; 32]);
assert_eq!(
null_sha,
"0000000000000000000000000000000000000000000000000000000000000000"
);
assert_eq!(
full_sha,
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
);
}
}
}