optimize test suite

This commit is contained in:
hdt3213 2025-04-15 07:17:47 +08:00
parent 5da92a3d53
commit 1f5412003d
2 changed files with 15 additions and 15 deletions

View File

@ -1777,7 +1777,7 @@ async fn add_documents_with_geo_field() {
},
{
"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",
"_geo": {
"lat": "1",
"lng": "1"
"lat": "2",
"lng": "2"
}
}
],
@ -1848,14 +1848,6 @@ async fn add_documents_with_geo_field() {
@r###"
{
"hits": [
{
"id": "4",
"_geo": {
"lat": "1",
"lng": "1"
},
"_geoDistance": 5522018
},
{
"id": "3",
"_geo": {
@ -1864,6 +1856,14 @@ async fn add_documents_with_geo_field() {
},
"_geoDistance": 5522018
},
{
"id": "4",
"_geo": {
"lat": "2",
"lng": "2"
},
"_geoDistance": 5408322
},
{
"id": "1"
},

View File

@ -176,11 +176,11 @@ fn test_geo_sort_reached_max_bucket_size() {
assert_eq!(iterative_ids.len(), 15);
for id_str in &iterative_ids[0..6] {
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] {
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();
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);
for id_str in &rtree_ids[0..6] {
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] {
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();
insta::assert_snapshot!(format!("{no_geo_ids:?}"), @r#"["1", "4", "3", "2", "5"]"#);