mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
throw an error if the top left corner is found below the bottom right corner
This commit is contained in:
parent
1b005f697d
commit
7a38fe624f
4 changed files with 28 additions and 11 deletions
|
@ -1583,20 +1583,27 @@ pub(crate) mod tests {
|
|||
.unwrap();
|
||||
insta::assert_debug_snapshot!(search_result.candidates, @"RoaringBitmap<[4]>");
|
||||
|
||||
// the requests that doesn't make sense
|
||||
|
||||
// try to wrap around the latitude
|
||||
let search_result = search
|
||||
let error = search
|
||||
.filter(Filter::from_str("_geoBoundingBox([-80, 0], [80, 0])").unwrap().unwrap())
|
||||
.execute()
|
||||
.unwrap();
|
||||
insta::assert_debug_snapshot!(search_result.candidates, @"RoaringBitmap<[]>");
|
||||
.unwrap_err();
|
||||
insta::assert_display_snapshot!(error, @r###"
|
||||
The top latitude `-80` is below the bottom latitude `80`.
|
||||
32:33 _geoBoundingBox([-80, 0], [80, 0])
|
||||
"###);
|
||||
|
||||
// the request that doesn't make sense
|
||||
// send a top latitude lower than the bottow latitude
|
||||
let search_result = search
|
||||
let error = search
|
||||
.filter(Filter::from_str("_geoBoundingBox([-10, 0], [10, 0])").unwrap().unwrap())
|
||||
.execute()
|
||||
.unwrap();
|
||||
insta::assert_debug_snapshot!(search_result.candidates, @"RoaringBitmap<[]>");
|
||||
.unwrap_err();
|
||||
insta::assert_display_snapshot!(error, @r###"
|
||||
The top latitude `-10` is below the bottom latitude `10`.
|
||||
32:33 _geoBoundingBox([-10, 0], [10, 0])
|
||||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue