orion icon indicating copy to clipboard operation
orion copied to clipboard

Add tests for trait implementations on newtypes

Open brycx opened this issue 4 years ago • 0 comments

To check that all newtypes (SecretKeys, Poly1305, etc.) implement the correct traits, new testing functions are needed.

For example fn test_traits_secret_key<Secret: Debug + Drop + PartialEq>() {} could be used to check that a secret key implements the needed traits in a test like so:

fn test_traits_secret_key<Secret: Debug + Drop + PartialEq>() {}

#[test]
fn test_implemented_traits() {
    test_traits_secret_key<hmac::SecretKey>();
}

brycx avatar Feb 25 '20 11:02 brycx