mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 16:06:31 +00:00 
			
		
		
		
	add test for authorize_typos in update
This commit is contained in:
		| @@ -518,6 +518,7 @@ mod tests { | ||||
|  | ||||
|     use super::*; | ||||
|     use crate::error::Error; | ||||
|     use crate::index::tests::TempIndex; | ||||
|     use crate::update::IndexDocuments; | ||||
|     use crate::{Criterion, Filter, SearchResult}; | ||||
|  | ||||
| @@ -1218,4 +1219,18 @@ mod tests { | ||||
|         let line = std::str::from_utf8(content.get(fid).unwrap()).unwrap(); | ||||
|         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()); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user