Skip to content
Permalink
Browse files

use modern quickcheck test instead of macro

  • Loading branch information...
vincenthz committed May 13, 2019
1 parent e0616f1 commit a7cade2301c2d187badfd62af5abe6702f133706
@@ -21,6 +21,7 @@ cfg-if = "0.1"

[dev-dependencies]
quickcheck = "0.8"
quickcheck_macros = "0.8"
rand_chacha = "0.1"

[features]
@@ -120,12 +120,13 @@ mod test {
use crate::key::{KeyPair, PublicKey};
use crate::sign::test::{keypair_signing_ko, keypair_signing_ok};

quickcheck! {
#[quickcheck]
fn sign_ok(input: (KeyPair<Ed25519>, Vec<u8>)) -> bool {
keypair_signing_ok(input)
}

#[quickcheck]
fn sign_ko(input: (KeyPair<Ed25519>, PublicKey<Ed25519>, Vec<u8>)) -> bool {
keypair_signing_ko(input)
}
}
}
@@ -99,12 +99,12 @@ mod test {
use crate::key::{KeyPair, PublicKey};
use crate::sign::test::{keypair_signing_ko, keypair_signing_ok};

quickcheck! {
#[quickcheck]
fn sign_ok(input: (KeyPair<Ed25519Bip32>, Vec<u8>)) -> bool {
keypair_signing_ok(input)
}
#[quickcheck]
fn sign_ko(input: (KeyPair<Ed25519Bip32>, PublicKey<Ed25519Bip32>, Vec<u8>)) -> bool {
keypair_signing_ko(input)
}
}
}
@@ -109,12 +109,19 @@ mod test {
use crate::key::{KeyPair, PublicKey};
use crate::sign::test::{keypair_signing_ko, keypair_signing_ok};

quickcheck! {
#[quickcheck]
fn sign_ok(input: (KeyPair<Ed25519Extended>, Vec<u8>)) -> bool {
keypair_signing_ok(input)
}
fn sign_ko(input: (KeyPair<Ed25519Extended>, PublicKey<Ed25519Extended>, Vec<u8>)) -> bool {

#[quickcheck]
fn sign_ko(
input: (
KeyPair<Ed25519Extended>,
PublicKey<Ed25519Extended>,
Vec<u8>,
),
) -> bool {
keypair_signing_ko(input)
}
}
}
@@ -8,8 +8,10 @@ extern crate cfg_if;
extern crate test;

#[cfg(test)]
#[macro_use]
extern crate quickcheck;
#[cfg(test)]
#[macro_use(quickcheck)]
extern crate quickcheck_macros;

cfg_if! {
if #[cfg(test)] {

0 comments on commit a7cade2

Please sign in to comment.
You can’t perform that action at this time.