mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-11-04 01:46:28 +00:00 
			
		
		
		
	Add simple delete test
This commit is contained in:
		@@ -2332,6 +2332,32 @@ pub(crate) mod tests {
 | 
			
		||||
        "###);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn simple_delete() {
 | 
			
		||||
        let mut index = TempIndex::new();
 | 
			
		||||
        index.index_documents_config.update_method = IndexDocumentsMethod::UpdateDocuments;
 | 
			
		||||
        index
 | 
			
		||||
            .add_documents(documents!([
 | 
			
		||||
                { "id": 30 },
 | 
			
		||||
                { "id": 34 }
 | 
			
		||||
            ]))
 | 
			
		||||
            .unwrap();
 | 
			
		||||
 | 
			
		||||
        db_snap!(index, documents_ids, @"[0, 1, ]");
 | 
			
		||||
        db_snap!(index, external_documents_ids, 1, @r###"
 | 
			
		||||
        docids:
 | 
			
		||||
        30                       0
 | 
			
		||||
        34                       1"###);
 | 
			
		||||
 | 
			
		||||
        index.delete_document("34");
 | 
			
		||||
 | 
			
		||||
        db_snap!(index, documents_ids, @"[0, ]");
 | 
			
		||||
        db_snap!(index, external_documents_ids, 2, @r###"
 | 
			
		||||
        docids:
 | 
			
		||||
        30                       0
 | 
			
		||||
        "###);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn bug_3021_second() {
 | 
			
		||||
        // https://github.com/meilisearch/meilisearch/issues/3021
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user