add tests on typo criterion

This commit is contained in:
many
2021-02-24 10:25:22 +01:00
committed by Kerollmops
parent c5a32fd4fa
commit fb7e6df790
3 changed files with 293 additions and 2 deletions

View File

@ -94,11 +94,15 @@ pub enum QueryKind {
}
impl QueryKind {
fn exact(word: String) -> Self {
pub fn exact(word: String) -> Self {
QueryKind::Exact { original_typo: 0, word }
}
fn tolerant(typo: u8, word: String) -> Self {
pub fn exact_with_typo(original_typo: u8, word: String) -> Self {
QueryKind::Exact { original_typo, word }
}
pub fn tolerant(typo: u8, word: String) -> Self {
QueryKind::Tolerant { typo, word }
}