Crates.io | bitcoin-proptest |
lib.rs | bitcoin-proptest |
version | 0.0.1-alpha.3 |
source | src |
created_at | 2024-04-27 14:35:54.634406 |
updated_at | 2024-07-01 09:44:26.023385 |
description | Proptest strategies for Bitcoin-related code |
homepage | |
repository | https://jirijakes.com/code/rust-bitcoin-proptest |
max_upload_size | |
id | 1222647 |
size | 75,458 |
Proptest strategies for Bitcoin-related code.
This collection of generators (called strategies in proptest's terminology) helps developers of Bitcoin-related software written in Rust supply random data – both valid and invalid – to their property-based tests.
Visit documentation for details.
#[cfg(test)]
mod tests {
proptest! {
#[test]
// generates valid hex-encoded public keys, both compressed and uncompressed
fn pubkey_parsing(s in prop::secp256k1::public_key::valid::hex()) {
prop_assert!(s.len() == 66 || s.len() == 130);
prop_assert!(my_parser(s).is_ok());
}
}
}