From dabbdce4d5fc8fe923791582d4dbc6e93b651e27 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Mon, 20 Jul 2020 13:47:19 +0200 Subject: [PATCH] Fix nit in bit count support and add test for that --- src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 40ad59d..fe9794f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -102,7 +102,7 @@ impl error::Error for Error { /// mnemonic from all the supported languages. (Languages have to be explicitly enabled using /// the Cargo features.) /// -/// Supported number of words are 6, 12, 18 and 24. +/// Supported number of words are 12, 18 and 24. #[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Mnemonic(String); // The content of the mnemonic is ensured to be NFKD-normalized UTF-8. @@ -367,6 +367,14 @@ mod tests { use bitcoin_hashes::hex::FromHex; + #[cfg(feature = "rand")] + #[test] + fn test_bit_counts() { + let _ = Mnemonic::generate(12).unwrap(); + let _ = Mnemonic::generate(18).unwrap(); + let _ = Mnemonic::generate(24).unwrap(); + } + #[cfg(feature = "rand")] #[test] fn test_language_of() {