Skip to content

Commit

Permalink
Remove schnorrsig from test names
Browse files Browse the repository at this point in the history
Recently we moved from using the identifier 'schnorrsig' to 'schnorr',
we omitted to update the tests.

While we are at it use more idiomatic Rust unit test names (i.e., do not
start test name with `test_` because it stutters when the name is read
in output of `cargo test`).
  • Loading branch information
tcharding committed Mar 1, 2022
1 parent 67367a8 commit cc30497
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/schnorr.rs
Expand Up @@ -304,8 +304,8 @@ mod tests {

#[test]
#[cfg(all(feature = "std", feature = "rand-std"))]
fn test_schnorrsig_sign_with_aux_rand_verify() {
test_schnorrsig_sign_helper(|secp, msg, seckey, rng| {
fn schnorr_sign_with_aux_rand_verify() {
sign_helper(|secp, msg, seckey, rng| {
let mut aux_rand = [0u8; 32];
rng.fill_bytes(&mut aux_rand);
secp.sign_schnorr_with_aux_rand(msg, seckey, &aux_rand)
Expand All @@ -314,30 +314,30 @@ mod tests {

#[test]
#[cfg(all(feature = "std", feature = "rand-std"))]
fn test_schnorrsig_sign_with_rng_verify() {
test_schnorrsig_sign_helper(|secp, msg, seckey, mut rng| {
fn schnor_sign_with_rng_verify() {
sign_helper(|secp, msg, seckey, mut rng| {
secp.sign_schnorr_with_rng(msg, seckey, &mut rng)
})
}

#[test]
#[cfg(all(feature = "std", feature = "rand-std"))]
fn test_schnorrsig_sign_verify() {
test_schnorrsig_sign_helper(|secp, msg, seckey, _| {
fn schnorr_sign_verify() {
sign_helper(|secp, msg, seckey, _| {
secp.sign_schnorr(msg, seckey)
})
}

#[test]
#[cfg(all(feature = "std", feature = "rand-std"))]
fn test_schnorrsig_sign_no_aux_rand_verify() {
test_schnorrsig_sign_helper(|secp, msg, seckey, _| {
fn schnorr_sign_no_aux_rand_verify() {
sign_helper(|secp, msg, seckey, _| {
secp.sign_schnorr_no_aux_rand(msg, seckey)
})
}

#[cfg(all(feature = "std", feature = "rand-std"))]
fn test_schnorrsig_sign_helper(
fn sign_helper(
sign: fn(&Secp256k1<All>, &Message, &KeyPair, &mut ThreadRng) -> Signature,
) {
let secp = Secp256k1::new();
Expand All @@ -361,7 +361,7 @@ mod tests {
#[test]
#[cfg(any(feature = "alloc", feature = "std"))]
#[cfg(not(fuzzing))] // fixed sig vectors can't work with fuzz-sigs
fn test_schnorrsig_sign() {
fn schnorr_sign() {
let secp = Secp256k1::new();

let hex_msg = hex_32!("E48441762FB75010B2AA31A512B62B4148AA3FB08EB0765D76B252559064A614");
Expand All @@ -384,7 +384,7 @@ mod tests {
#[test]
#[cfg(not(fuzzing))] // fixed sig vectors can't work with fuzz-sigs
#[cfg(any(feature = "alloc", feature = "std"))]
fn test_schnorrsig_verify() {
fn schnorr_verify() {
let secp = Secp256k1::new();

let hex_msg = hex_32!("E48441762FB75010B2AA31A512B62B4148AA3FB08EB0765D76B252559064A614");
Expand Down

0 comments on commit cc30497

Please sign in to comment.