mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 13:24:27 +01:00
add test for authorize_typos in update
This commit is contained in:
parent
6ef3bb9d83
commit
3e34981d9b
@ -518,6 +518,7 @@ mod tests {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
|
use crate::index::tests::TempIndex;
|
||||||
use crate::update::IndexDocuments;
|
use crate::update::IndexDocuments;
|
||||||
use crate::{Criterion, Filter, SearchResult};
|
use crate::{Criterion, Filter, SearchResult};
|
||||||
|
|
||||||
@ -1218,4 +1219,18 @@ mod tests {
|
|||||||
let line = std::str::from_utf8(content.get(fid).unwrap()).unwrap();
|
let line = std::str::from_utf8(content.get(fid).unwrap()).unwrap();
|
||||||
assert_eq!(line, r#""Star Wars""#);
|
assert_eq!(line, r#""Star Wars""#);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_disable_typo() {
|
||||||
|
let index = TempIndex::new();
|
||||||
|
|
||||||
|
let mut txn = index.write_txn().unwrap();
|
||||||
|
let config = IndexerConfig::default();
|
||||||
|
|
||||||
|
assert!(index.authorize_typos(&txn).unwrap());
|
||||||
|
let mut builder = Settings::new(&mut txn, &index, &config);
|
||||||
|
builder.set_autorize_typos(false);
|
||||||
|
builder.execute(|_| ()).unwrap();
|
||||||
|
assert!(!index.authorize_typos(&txn).unwrap());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user