Add unit test to check ordering of supposedly ordered word lists

This commit is contained in:
Steven Roose 2024-01-29 18:30:05 +00:00
parent d8b046da28
commit 8bf5b20629
No known key found for this signature in database
GPG Key ID: 2F2A88D7F8D68E87
1 changed files with 19 additions and 0 deletions

View File

@ -325,6 +325,25 @@ mod tests {
assert!(ok);
}
#[test]
fn test_ordered_lists() {
let languages = [
Language::English,
#[cfg(feature = "portuguese")]
Language::Portuguese,
#[cfg(feature = "italian")]
Language::Italian,
#[cfg(feature = "korean")]
Language::Korean,
];
for lang in languages {
let mut list = lang.word_list().to_vec();
list.sort();
assert_eq!(list, lang.word_list());
}
}
/// Test the full round trip from index -> word-string -> index for all langauges
mod round_trip {
use super::*;