From af958a253a62739e7fb1976bc7282b8c832408b5 Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Wed, 10 Nov 2021 08:57:52 +1100 Subject: [PATCH] Add unit test for valid word counts We just enabled word counts of 15, add a unit test that verifies all the valid word count values. --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 1df56fa..05963e3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -609,6 +609,14 @@ mod tests { let _ = Mnemonic::generate_in_with(&mut rand::thread_rng(), Language::English, 24).unwrap(); } + #[cfg(feature = "rand")] + #[test] + fn test_generate_word_counts() { + for word_count in [12, 15, 18, 21, 24].iter() { + let _ = Mnemonic::generate(*word_count).unwrap(); + } + } + #[test] fn test_vectors_english() { // These vectors are tuples of