Skip to content

Commit

Permalink
Remove testutils feature so doctests worka again
Browse files Browse the repository at this point in the history
I wanted to only conditionally compile testutils but it's needed in
doctests which we can't conditionally compile for:

rust-lang/rust#67295
  • Loading branch information
LLFourn committed May 19, 2021
1 parent 8446983 commit b44bc51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ all-keys = ["keys-bip39"]
keys-bip39 = ["tiny-bip39"]

# Debug/Test features
testutils = []
test-blockchains = ["testutils", "bitcoincore-rpc", "electrum-client"]
test-blockchains = ["bitcoincore-rpc", "electrum-client"]
test-md-docs = ["electrum"]

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/database/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ macro_rules! doctest_wallet {
() => {{
use $crate::bitcoin::Network;
use $crate::database::MemoryDatabase;
use testutils::testutils;
use $crate::testutils;
let descriptor = "wpkh(cVpPVruEDdmutPzisEsYvtST1usBR3ntr8pXSyt6D2YYqXRyPcFW)";
let descriptors = testutils!(@descriptors (descriptor) (descriptor));

Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,9 @@ pub fn version() -> &'static str {
env!("CARGO_PKG_VERSION", "unknown")
}

#[cfg(any(feature = "testutils", test))]
// We should consider putting this under a feature flag but we need the macro in doctets so we need
// to wait until https://github.com/rust-lang/rust/issues/67295 is fixed.
//
// Stuff in here is too rough to document atm
#[doc(hidden)]
pub mod testutils;

0 comments on commit b44bc51

Please sign in to comment.