mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-10-31 07:56:28 +00:00 
			
		
		
		
	Fix tests
This commit is contained in:
		| @@ -123,7 +123,7 @@ fn test_attribute_fid_simple() { | ||||
|     s.terms_matching_strategy(TermsMatchingStrategy::All); | ||||
|     s.query("the quick brown fox jumps over the lazy dog"); | ||||
|     let SearchResult { documents_ids, .. } = s.execute().unwrap(); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[2, 6, 5, 4, 3, 9, 7, 8, 11, 10, 12, 13, 14, 0]"); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[2, 6, 5, 4, 3, 9, 8, 7, 11, 10, 13, 12, 14, 0]"); | ||||
| } | ||||
|  | ||||
| #[test] | ||||
| @@ -136,5 +136,5 @@ fn test_attribute_fid_ngrams() { | ||||
|     s.terms_matching_strategy(TermsMatchingStrategy::All); | ||||
|     s.query("the quick brown fox jumps over the lazy dog"); | ||||
|     let SearchResult { documents_ids, .. } = s.execute().unwrap(); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[2, 6, 5, 4, 3, 9, 7, 8, 11, 10, 12, 13, 14, 0]"); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[2, 6, 5, 4, 3, 9, 8, 7, 11, 10, 13, 12, 14, 0]"); | ||||
| } | ||||
|   | ||||
| @@ -138,7 +138,7 @@ fn test_attribute_position_simple() { | ||||
|     s.terms_matching_strategy(TermsMatchingStrategy::All); | ||||
|     s.query("quick brown"); | ||||
|     let SearchResult { documents_ids, .. } = s.execute().unwrap(); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[10, 11, 12, 13, 2, 3, 4, 1, 0, 6, 8, 7, 9, 5]"); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[10, 12, 11, 13, 3, 4, 2, 0, 1, 6, 8, 7, 9, 5]"); | ||||
| } | ||||
| #[test] | ||||
| fn test_attribute_position_repeated() { | ||||
| @@ -163,7 +163,7 @@ fn test_attribute_position_different_fields() { | ||||
|     s.terms_matching_strategy(TermsMatchingStrategy::All); | ||||
|     s.query("quick brown"); | ||||
|     let SearchResult { documents_ids, .. } = s.execute().unwrap(); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[10, 11, 12, 13, 2, 3, 4, 1, 0, 6, 8, 7, 9, 5]"); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[10, 12, 11, 13, 3, 4, 2, 0, 1, 6, 8, 7, 9, 5]"); | ||||
| } | ||||
|  | ||||
| #[test] | ||||
| @@ -176,5 +176,5 @@ fn test_attribute_position_ngrams() { | ||||
|     s.terms_matching_strategy(TermsMatchingStrategy::All); | ||||
|     s.query("quick brown"); | ||||
|     let SearchResult { documents_ids, .. } = s.execute().unwrap(); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[10, 11, 12, 13, 2, 3, 4, 1, 0, 6, 8, 7, 9, 5]"); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[10, 12, 11, 13, 3, 4, 2, 0, 1, 6, 8, 7, 9, 5]"); | ||||
| } | ||||
|   | ||||
| @@ -270,13 +270,13 @@ fn test_proximity_simple() { | ||||
|     s.terms_matching_strategy(TermsMatchingStrategy::All); | ||||
|     s.query("the quick brown fox jumps over the lazy dog"); | ||||
|     let SearchResult { documents_ids, .. } = s.execute().unwrap(); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[4, 9, 10, 7, 6, 5, 2, 3, 0, 1]"); | ||||
|     insta::assert_snapshot!(format!("{documents_ids:?}"), @"[9, 10, 4, 7, 6, 5, 2, 3, 0, 1]"); | ||||
|     let texts = collect_field_values(&index, &txn, "text", &documents_ids); | ||||
|     insta::assert_debug_snapshot!(texts, @r###" | ||||
|     [ | ||||
|         "\"the quickbrown fox jumps over the lazy dog\"", | ||||
|         "\"the quack brown fox jumps over the lazy dog\"", | ||||
|         "\"the quick brown fox jumps over the lazy dog\"", | ||||
|         "\"the quickbrown fox jumps over the lazy dog\"", | ||||
|         "\"the really quick brown fox jumps over the lazy dog\"", | ||||
|         "\"the really quick brown fox jumps over the very lazy dog\"", | ||||
|         "\"brown quick fox jumps over the lazy dog\"", | ||||
|   | ||||
| @@ -68,7 +68,7 @@ | ||||
|     "word_rank": 0, | ||||
|     "typo_rank": 1, | ||||
|     "proximity_rank": 16, | ||||
|     "attribute_rank": 208, | ||||
|     "attribute_rank": 209, | ||||
|     "exact_rank": 5, | ||||
|     "asc_desc_rank": 3, | ||||
|     "sort_by_rank": 2, | ||||
| @@ -155,7 +155,7 @@ | ||||
|     "word_rank": 1, | ||||
|     "typo_rank": 0, | ||||
|     "proximity_rank": 1, | ||||
|     "attribute_rank": 1, | ||||
|     "attribute_rank": 2, | ||||
|     "exact_rank": 3, | ||||
|     "asc_desc_rank": 4, | ||||
|     "sort_by_rank": 1, | ||||
| @@ -199,7 +199,7 @@ | ||||
|     "word_rank": 1, | ||||
|     "typo_rank": 0, | ||||
|     "proximity_rank": 1, | ||||
|     "attribute_rank": 2, | ||||
|     "attribute_rank": 1, | ||||
|     "exact_rank": 3, | ||||
|     "asc_desc_rank": 2, | ||||
|     "sort_by_rank": 1, | ||||
| @@ -220,7 +220,7 @@ | ||||
|     "word_rank": 0, | ||||
|     "typo_rank": 2, | ||||
|     "proximity_rank": 10, | ||||
|     "attribute_rank": 209, | ||||
|     "attribute_rank": 208, | ||||
|     "exact_rank": 6, | ||||
|     "asc_desc_rank": 1, | ||||
|     "sort_by_rank": 2, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user