mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00:00
Lower error check, already check in meilisearch
This commit is contained in:
@ -318,50 +318,4 @@ mod tests {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sort_error_message() {
|
||||
let errors = [
|
||||
(
|
||||
AscDescError::InvalidSyntax { name: S("truc:machin") },
|
||||
S("invalid syntax for the sort parameter `truc:machin`."),
|
||||
),
|
||||
(
|
||||
AscDescError::InvalidSyntax { name: S("hello:world") },
|
||||
S("invalid syntax for the sort parameter `hello:world`."),
|
||||
),
|
||||
(
|
||||
AscDescError::ReservedKeyword { name: S("_geo") },
|
||||
S("`_geo` is a reserved keyword and thus can't be used as a sort expression. Use the `_geoPoint(latitude, longitude)` built-in rule to sort on `_geo` field coordinates."),
|
||||
),
|
||||
(
|
||||
AscDescError::ReservedKeyword { name: S("_geoDistance") },
|
||||
S("_geoDistance is a reserved keyword and thus can't be used as a sort expression.")
|
||||
),
|
||||
(
|
||||
AscDescError::ReservedKeyword { name: S("_geoRadius(12, 13)") },
|
||||
S("`_geoRadius` is a reserved keyword and thus can't be used as a sort expression. Use the `_geoPoint(latitude, longitude)` built-in rule to sort on `_geo` field coordinates."),
|
||||
),
|
||||
(
|
||||
AscDescError::InvalidLatitude,
|
||||
S("Latitude must be contained between -90 and 90 degrees."),
|
||||
),
|
||||
(
|
||||
AscDescError::InvalidLongitude,
|
||||
S("Longitude must be contained between -180 and 180 degrees."),
|
||||
),
|
||||
];
|
||||
|
||||
for (asc_desc_error, expected_message) in errors {
|
||||
let sort_error = SortError::from(asc_desc_error);
|
||||
assert_eq!(
|
||||
sort_error.to_string(),
|
||||
expected_message,
|
||||
"was expecting {} for the error {:?} but instead got {}",
|
||||
expected_message,
|
||||
sort_error,
|
||||
sort_error.to_string()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user