handle _geo(x,x) sort error

This commit is contained in:
Filip Bachul 2023-03-30 23:17:34 +02:00
parent 7871d12025
commit 53aa0a1b54

View File

@ -81,6 +81,7 @@ impl FromStr for Member {
if is_reserved_keyword(text)
|| text.starts_with("_geoRadius(")
|| text.starts_with("_geoBoundingBox(")
|| text.starts_with("_geo(")
{
return Err(AscDescError::ReservedKeyword { name: text.to_string() })?;
}
@ -265,6 +266,8 @@ mod tests {
("_geoPoint(0, -180.000001):desc", GeoError(BadGeoError::Lng(-180.000001))),
("_geoPoint(159.256, 130):asc", GeoError(BadGeoError::Lat(159.256))),
("_geoPoint(12, -2021):desc", GeoError(BadGeoError::Lng(-2021.))),
("_geo(12, -2021):asc", ReservedKeyword { name: S("_geo(12, -2021)") }),
("_geo(12, -2021):desc", ReservedKeyword { name: S("_geo(12, -2021)") }),
];
for (req, expected_error) in invalid_req {