mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-05-14 16:23:57 +02:00
optimize test suite
This commit is contained in:
parent
5da92a3d53
commit
1f5412003d
@ -1777,7 +1777,7 @@ async fn add_documents_with_geo_field() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "4",
|
"id": "4",
|
||||||
"_geo": { "lat": "1", "lng": "1" },
|
"_geo": { "lat": "2", "lng": "2" },
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -1828,8 +1828,8 @@ async fn add_documents_with_geo_field() {
|
|||||||
{
|
{
|
||||||
"id": "4",
|
"id": "4",
|
||||||
"_geo": {
|
"_geo": {
|
||||||
"lat": "1",
|
"lat": "2",
|
||||||
"lng": "1"
|
"lng": "2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1848,14 +1848,6 @@ async fn add_documents_with_geo_field() {
|
|||||||
@r###"
|
@r###"
|
||||||
{
|
{
|
||||||
"hits": [
|
"hits": [
|
||||||
{
|
|
||||||
"id": "4",
|
|
||||||
"_geo": {
|
|
||||||
"lat": "1",
|
|
||||||
"lng": "1"
|
|
||||||
},
|
|
||||||
"_geoDistance": 5522018
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "3",
|
"id": "3",
|
||||||
"_geo": {
|
"_geo": {
|
||||||
@ -1864,6 +1856,14 @@ async fn add_documents_with_geo_field() {
|
|||||||
},
|
},
|
||||||
"_geoDistance": 5522018
|
"_geoDistance": 5522018
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "4",
|
||||||
|
"_geo": {
|
||||||
|
"lat": "2",
|
||||||
|
"lng": "2"
|
||||||
|
},
|
||||||
|
"_geoDistance": 5408322
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "1"
|
"id": "1"
|
||||||
},
|
},
|
||||||
|
@ -176,11 +176,11 @@ fn test_geo_sort_reached_max_bucket_size() {
|
|||||||
assert_eq!(iterative_ids.len(), 15);
|
assert_eq!(iterative_ids.len(), 15);
|
||||||
for id_str in &iterative_ids[0..6] {
|
for id_str in &iterative_ids[0..6] {
|
||||||
let id = id_str.parse::<u32>().unwrap();
|
let id = id_str.parse::<u32>().unwrap();
|
||||||
assert!(id >= 6 && id <= 11)
|
assert!((6..=11).contains(&id))
|
||||||
}
|
}
|
||||||
for id_str in &iterative_ids[6..10] {
|
for id_str in &iterative_ids[6..10] {
|
||||||
let id = id_str.parse::<u32>().unwrap();
|
let id = id_str.parse::<u32>().unwrap();
|
||||||
assert!(id >= 12 && id <= 15)
|
assert!((12..=15).contains(&id))
|
||||||
}
|
}
|
||||||
let no_geo_ids = iterative_ids[10..].iter().collect_vec();
|
let no_geo_ids = iterative_ids[10..].iter().collect_vec();
|
||||||
insta::assert_snapshot!(format!("{no_geo_ids:?}"), @r#"["1", "4", "3", "2", "5"]"#);
|
insta::assert_snapshot!(format!("{no_geo_ids:?}"), @r#"["1", "4", "3", "2", "5"]"#);
|
||||||
@ -192,11 +192,11 @@ fn test_geo_sort_reached_max_bucket_size() {
|
|||||||
assert_eq!(rtree_ids.len(), 15);
|
assert_eq!(rtree_ids.len(), 15);
|
||||||
for id_str in &rtree_ids[0..6] {
|
for id_str in &rtree_ids[0..6] {
|
||||||
let id = id_str.parse::<u32>().unwrap();
|
let id = id_str.parse::<u32>().unwrap();
|
||||||
assert!(id >= 6 && id <= 11)
|
assert!((6..=11).contains(&id))
|
||||||
}
|
}
|
||||||
for id_str in &rtree_ids[6..10] {
|
for id_str in &rtree_ids[6..10] {
|
||||||
let id = id_str.parse::<u32>().unwrap();
|
let id = id_str.parse::<u32>().unwrap();
|
||||||
assert!(id >= 12 && id <= 15)
|
assert!((12..=15).contains(&id))
|
||||||
}
|
}
|
||||||
let no_geo_ids = rtree_ids[10..].iter().collect_vec();
|
let no_geo_ids = rtree_ids[10..].iter().collect_vec();
|
||||||
insta::assert_snapshot!(format!("{no_geo_ids:?}"), @r#"["1", "4", "3", "2", "5"]"#);
|
insta::assert_snapshot!(format!("{no_geo_ids:?}"), @r#"["1", "4", "3", "2", "5"]"#);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user