Skip to content

Commit

Permalink
test(types): Add mutation tests
Browse files Browse the repository at this point in the history
Relates to: #78
  • Loading branch information
Johennes committed Apr 9, 2024
1 parent 7d51bd6 commit 191ac70
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

0 comments on commit 191ac70

Please sign in to comment.