Fix tests

This commit is contained in:
Clémentine Urquizar 2021-05-06 18:41:04 +02:00
parent 60f6d1c373
commit 93002e734c
No known key found for this signature in database
GPG Key ID: D8E7CC7422E77E1A

View File

@ -423,6 +423,7 @@ mod test {
let all_formatted = Vec::new(); let all_formatted = Vec::new();
let to_highlight_ids = HashSet::new(); let to_highlight_ids = HashSet::new();
let to_crop_ids = HashSet::new();
let matching_words = MatchingWords::default(); let matching_words = MatchingWords::default();
@ -433,8 +434,8 @@ mod test {
&matching_words, &matching_words,
&all_formatted, &all_formatted,
&to_highlight_ids, &to_highlight_ids,
) &to_crop_ids,
.unwrap(); ).unwrap();
assert!(value.is_empty()); assert!(value.is_empty());
} }
@ -458,6 +459,7 @@ mod test {
let all_formatted = vec![id]; let all_formatted = vec![id];
let to_highlight_ids = HashSet::new(); let to_highlight_ids = HashSet::new();
let to_crop_ids = HashSet::new();
let matching_words = MatchingWords::default(); let matching_words = MatchingWords::default();
@ -468,8 +470,8 @@ mod test {
&matching_words, &matching_words,
&all_formatted, &all_formatted,
&to_highlight_ids, &to_highlight_ids,
) &to_crop_ids,
.unwrap(); ).unwrap();
assert_eq!(value["test"], "hello"); assert_eq!(value["test"], "hello");
} }
@ -493,6 +495,7 @@ mod test {
let all_formatted = vec![id]; let all_formatted = vec![id];
let to_highlight_ids = HashSet::from_iter(Some(id)); let to_highlight_ids = HashSet::from_iter(Some(id));
let to_crop_ids = HashSet::new();
let matching_words = HashSet::from_iter(Some(String::from("hello"))); let matching_words = HashSet::from_iter(Some(String::from("hello")));
@ -503,8 +506,8 @@ mod test {
&matching_words, &matching_words,
&all_formatted, &all_formatted,
&to_highlight_ids, &to_highlight_ids,
) &to_crop_ids,
.unwrap(); ).unwrap();
assert_eq!(value["test"], "<em>hello</em>"); assert_eq!(value["test"], "<em>hello</em>");
} }