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.
This commit is contained in:
Tobin Harding 2021-11-10 08:57:52 +11:00
parent 60144920f3
commit af958a253a
1 changed files with 8 additions and 0 deletions

View File

@ -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