diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index 25f3e92a3..17924da8a 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -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()); + } }