From eddb3acacdcbd89264e3616f3a98f427f60377de Mon Sep 17 00:00:00 2001 From: javalsai Date: Thu, 26 Mar 2026 12:57:14 +0100 Subject: [PATCH] test: add some test --- src/utils.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/utils.rs b/src/utils.rs index a619b5e..8b425b2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -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" + ); + } + } }