diff --git a/.travis.yml b/.travis.yml index 72f94de..b644d5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ matrix: script: - cargo $TEST_COMMAND --features="$FEATURES" $EXTRA_FLAGS + - cargo test --features=batch notifications: slack: diff --git a/src/batch.rs b/src/batch.rs index a778934..dc81ec3 100644 --- a/src/batch.rs +++ b/src/batch.rs @@ -223,3 +223,18 @@ pub fn verify_batch( Err(SignatureError(InternalError::VerifyError)) } } + +#[test] +fn verify_batch_not_flaky_on_empty_input() { + for _ in 0..100 { + match + verify_batch( + &[&[]], + &[Signature::from_bytes(&[0u8; 64]).unwrap()], + &[PublicKey::from_bytes(&[0u8; 32]).unwrap()], + ) { + Ok(_) => panic!("Successfully verified empty message with empty signature and empty public"), + Err(_) => continue, + } + } +} \ No newline at end of file