From 4b948e67a77e11f704a52ed33b7f291e4ba769e1 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 27 Apr 2021 22:42:22 +1000 Subject: [PATCH] Add extra crate dependencies to the proptest docs (#2071) --- book/src/dev/proptests.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/book/src/dev/proptests.md b/book/src/dev/proptests.md index 035a58644..6b3c2cb90 100644 --- a/book/src/dev/proptests.md +++ b/book/src/dev/proptests.md @@ -5,5 +5,12 @@ Zebra uses the [proptest](https://docs.rs/proptest/) crate for randomised proper Most types in `zebra-chain` have an `Arbitrary` implementation, which generates randomised test cases. When we want to use those `Arbitrary` impls in proptests in other crates, we use the `proptest-impl` feature as a dev dependency: -* in `zebra-chain`: make the `Arbitrary` impl depend on `#[cfg(any(test, feature = "proptest-impl"))]` -* in the other crate: add zebra-chain as a dev dependency: `zebra-chain = { path = "../zebra-chain", features = ["proptest-impl"] }` +1. in `zebra-chain`: make the `Arbitrary` impl depend on `#[cfg(any(test, feature = "proptest-impl"))]` +2. in the other crate: add zebra-chain as a dev dependency: `zebra-chain = { path = "../zebra-chain", features = ["proptest-impl"] }` + +If we need to add another dependency as part of the `proptest-impl` feature: +1. Add the crate name to the list of crates in the `proptest-impl` `features` entry +2. Add the crate as an optional `dependencies` entry +3. Add the crate as a required `dev-dependencies` entry + +For an example of these changes, see [PR 2070](https://github.com/ZcashFoundation/zebra/pull/2070/files).