Fix nit in bit count support and add test for that
This commit is contained in:
parent
32daa49834
commit
dabbdce4d5
10
src/lib.rs
10
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
|
/// mnemonic from all the supported languages. (Languages have to be explicitly enabled using
|
||||||
/// the Cargo features.)
|
/// 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)]
|
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct Mnemonic(String);
|
pub struct Mnemonic(String);
|
||||||
// The content of the mnemonic is ensured to be NFKD-normalized UTF-8.
|
// The content of the mnemonic is ensured to be NFKD-normalized UTF-8.
|
||||||
|
@ -367,6 +367,14 @@ mod tests {
|
||||||
|
|
||||||
use bitcoin_hashes::hex::FromHex;
|
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")]
|
#[cfg(feature = "rand")]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_language_of() {
|
fn test_language_of() {
|
||||||
|
|
Loading…
Reference in New Issue