Add a test to check index soft deletion works correctly

This commit is contained in:
Clément Renault 2019-11-06 10:49:31 +01:00
parent f3fc0bed45
commit 95eb6ad09a

View File

@ -765,4 +765,18 @@ mod tests {
}); });
assert_eq!(document, Some(new_doc2)); assert_eq!(document, Some(new_doc2));
} }
#[test]
fn delete_index() {
let dir = tempfile::tempdir().unwrap();
let database = Database::open_or_create(dir.path()).unwrap();
let _index = database.create_index("test").unwrap();
let deleted = database.delete_index("test").unwrap();
assert!(deleted);
let result = database.open_index("test");
assert!(result.is_none());
}
} }