Skip to content

Commit

Permalink
fix: test 'spell::hunspell::tests::correctly_expands_test_files' failed
Browse files Browse the repository at this point in the history
No assumptions should be made about the order in which a HashMap is iterated
  • Loading branch information
Cryolitia authored and elijah-potter committed Sep 10, 2024
1 parent 4e6564a commit 1336712
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions harper-core/src/spell/hunspell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn parse_default_attribute_list() -> AttributeList {

#[cfg(test)]
mod tests {
use hashbrown::HashMap;
use hashbrown::{HashMap, HashSet};
use serde_json::json;

use super::word_list::parse_word_list;
Expand Down Expand Up @@ -88,14 +88,17 @@ mod tests {
let mut expanded = HashMap::new();

attributes.expand_marked_words(words, &mut expanded);
let expanded: Vec<String> = expanded
let expanded: HashSet<String> = expanded
.into_iter()
.map(|v| v.0.into_iter().collect())
.collect();

assert_eq!(
expanded,
vec!["hello", "tried", "reworked", "rework", "worked", "work", "try"]
.into_iter()
.map(|v| v.into())
.collect()
)
}

Expand Down

0 comments on commit 1336712

Please sign in to comment.