add authorize_typo_test

This commit is contained in:
ad hoc 2022-03-31 09:54:49 +02:00
parent c4653347fd
commit f782fe2062
No known key found for this signature in database
GPG key ID: 4F00A782990CC643
2 changed files with 53 additions and 3 deletions

View file

@ -1009,4 +1009,18 @@ pub(crate) mod tests {
}
);
}
#[test]
fn put_and_retrieve_disable_typo() {
let index = TempIndex::new();
let mut txn = index.write_txn().unwrap();
// default value is true
assert!(index.authorize_typos(&txn).unwrap());
// set to false
index.put_authorize_typos(&mut txn, false).unwrap();
txn.commit().unwrap();
let txn = index.read_txn().unwrap();
assert!(!index.authorize_typos(&txn).unwrap());
}
}