From e81beb733ebe668a393c9f95f57f2fbd80f00d7a Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Mon, 29 Aug 2022 19:16:58 -0700 Subject: [PATCH] Add one more test for the hash. --- sub_crates/backend/src/hash.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sub_crates/backend/src/hash.rs b/sub_crates/backend/src/hash.rs index 4786147..8155f30 100644 --- a/sub_crates/backend/src/hash.rs +++ b/sub_crates/backend/src/hash.rs @@ -217,20 +217,27 @@ mod test { #[test] fn hash_string_02() { + let s = "abcdefghijklmnopqrstuvwxyz"; + let correct_digest = "dc59a6c0f41de0fbe405de9947fda7bab362b4fff00b02f0cda56d47a42dbfa8"; + assert_eq!(digest_to_string(hash(s.as_bytes())), correct_digest); + } + + #[test] + fn hash_string_03() { let s = "The quick brown fox jumps over the lazy dog."; let correct_digest = "7f69ce128ed82ed4bc8b8993b52555cf7e960669a8fd141b590b9e3d6e545b53"; assert_eq!(digest_to_string(hash(s.as_bytes())), correct_digest); } #[test] - fn hash_string_03() { + fn hash_string_04() { let s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let correct_digest = "1f8676c857099cf4fad280a6a9305f372e0d75341e52aa2b9cb3906324f9a4c7"; assert_eq!(digest_to_string(hash(s.as_bytes())), correct_digest); } #[test] - fn hash_string_04() { + fn hash_string_05() { let s = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; let correct_digest = "61675e48dd173196dc348114ef5dd1f38a04969e6436e5538d6da4ab0e6ab7cc"; assert_eq!(digest_to_string(hash(s.as_bytes())), correct_digest);