Skip to content

Commit

Permalink
test(kyberlib): 🐛 add a test case that triggers the KyberLibError::In…
Browse files Browse the repository at this point in the history
…validLength variant
  • Loading branch information
sebastienrousseau committed May 12, 2024
1 parent 39652f6 commit 3987945
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ fn test_kyber_lib_error_display() {
error.to_string(),
"The secret and public key given does not match."
);
let error = KyberLibError::InvalidLength;
assert_eq!(
error.to_string(),
"The length of the input buffer is invalid."
);
}

#[test]
Expand All @@ -54,6 +59,10 @@ fn test_kyber_lib_error_partial_eq() {
let error2 = KyberLibError::InvalidKey;
assert_eq!(error1, error2);

let error1 = KyberLibError::InvalidLength;
let error2 = KyberLibError::InvalidLength;
assert_eq!(error1, error2);

let error1 = KyberLibError::InvalidInput;
let error2 = KyberLibError::Decapsulation;
assert_ne!(error1, error2);
Expand Down

0 comments on commit 3987945

Please sign in to comment.