From 191ac70bedf67155bad9f8883fabd21db659290e Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Tue, 9 Apr 2024 11:36:55 +0200 Subject: [PATCH] test(types): Add mutation tests Relates to: #78 --- src/types/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/types/mod.rs b/src/types/mod.rs index 1e1b1e2e..04a269d1 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -58,3 +58,20 @@ pub enum KeyError { #[error("At least one of the keys did not have contributory behaviour")] NonContributoryKey, } + +#[cfg(test)] +mod test { + use crate::KeyId; + + #[test] + fn key_id_to_base64() { + assert_eq!(KeyId(0).to_base64(), "AAAAAAAAAAA"); + assert_eq!(KeyId(7).to_base64(), "AAAAAAAAAAc"); + } + + #[test] + fn key_id_to_string() { + assert_eq!(String::from(KeyId(0)), "AAAAAAAAAAA"); + assert_eq!(String::from(KeyId(7)), "AAAAAAAAAAc"); + } +}