diff --git a/meilidb-core/src/database.rs b/meilidb-core/src/database.rs index b65086ac2..0e40b695d 100644 --- a/meilidb-core/src/database.rs +++ b/meilidb-core/src/database.rs @@ -765,4 +765,18 @@ mod tests { }); 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()); + } }