Skip to content

Commit

Permalink
More complete LOL test
Browse files Browse the repository at this point in the history
  • Loading branch information
leontoeides committed May 13, 2024
1 parent 20910cf commit cde0210
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/simple/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,12 @@ fn simple() {
assert_eq!(autocomplete_options, vec!["stars are dancing".to_string()]);

// Test UTF-8:
let index = crate::simple::SearchIndex::<usize>::default();
index.search("лол"); // lol in Cyrillic
let mut search_index = crate::simple::SearchIndex::<usize>::default();
search_index.insert(&0, &"лол"); // lol in Cyrillic
search_index.insert(&1, &"lol");
search_index.insert(&2, &"lol лол");
search_index.insert(&3, &"лол lol");
let search_results = search_index.search("лол");
assert_eq!(search_results, vec![&0, &2, &3]);

} // fn

0 comments on commit cde0210

Please sign in to comment.