From c425f8ba56430ac1b94f6497b39d05770cbaef9a Mon Sep 17 00:00:00 2001 From: NikVolf Date: Sat, 22 Feb 2020 15:48:29 +0300 Subject: [PATCH 1/2] propose failing test --- src/batch.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 From 3769166144185b83d46b8985f5f909c4452c8cea Mon Sep 17 00:00:00 2001 From: NikVolf Date: Sat, 22 Feb 2020 15:55:18 +0300 Subject: [PATCH 2/2] add to travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) 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: