Skip to content

Commit af958a2

Browse files
committed
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.
1 parent 6014492 commit af958a2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,14 @@ mod tests {
609609
let _ = Mnemonic::generate_in_with(&mut rand::thread_rng(), Language::English, 24).unwrap();
610610
}
611611

612+
#[cfg(feature = "rand")]
613+
#[test]
614+
fn test_generate_word_counts() {
615+
for word_count in [12, 15, 18, 21, 24].iter() {
616+
let _ = Mnemonic::generate(*word_count).unwrap();
617+
}
618+
}
619+
612620
#[test]
613621
fn test_vectors_english() {
614622
// These vectors are tuples of

0 commit comments

Comments
 (0)