mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 20:15:07 +08:00
Add test
This commit is contained in:
parent
d4f54fc55e
commit
b744f33530
@ -30,7 +30,7 @@ pub(self) static DOCUMENTS: Lazy<Value> = Lazy::new(|| {
|
|||||||
"id": "166428",
|
"id": "166428",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Glass",
|
"title": "Gläss",
|
||||||
"id": "450465",
|
"id": "450465",
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@ -52,7 +52,7 @@ pub(self) static NESTED_DOCUMENTS: Lazy<Value> = Lazy::new(|| {
|
|||||||
"age": 4,
|
"age": 4,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"cattos": "pesti",
|
"cattos": "pésti",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 654,
|
"id": 654,
|
||||||
@ -142,7 +142,7 @@ async fn simple_search() {
|
|||||||
index.wait_task(1).await;
|
index.wait_task(1).await;
|
||||||
|
|
||||||
index
|
index
|
||||||
.search(json!({"q": "pesti"}), |response, code| {
|
.search(json!({"q": "pésti"}), |response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
assert_eq!(response["hits"].as_array().unwrap().len(), 2);
|
assert_eq!(response["hits"].as_array().unwrap().len(), 2);
|
||||||
})
|
})
|
||||||
@ -250,7 +250,7 @@ async fn search_multiple_params() {
|
|||||||
index
|
index
|
||||||
.search(
|
.search(
|
||||||
json!({
|
json!({
|
||||||
"q": "pesti",
|
"q": "pésti",
|
||||||
"attributesToCrop": ["catto:2"],
|
"attributesToCrop": ["catto:2"],
|
||||||
"attributesToHighlight": ["catto"],
|
"attributesToHighlight": ["catto"],
|
||||||
"limit": 2,
|
"limit": 2,
|
||||||
@ -281,7 +281,7 @@ async fn search_with_filter_string_notation() {
|
|||||||
index
|
index
|
||||||
.search(
|
.search(
|
||||||
json!({
|
json!({
|
||||||
"filter": "title = Glass"
|
"filter": "title = Gläss"
|
||||||
}),
|
}),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
@ -305,7 +305,7 @@ async fn search_with_filter_string_notation() {
|
|||||||
index
|
index
|
||||||
.search(
|
.search(
|
||||||
json!({
|
json!({
|
||||||
"filter": "cattos = pesti"
|
"filter": "cattos = pésti"
|
||||||
}),
|
}),
|
||||||
|response, code| {
|
|response, code| {
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
@ -343,7 +343,7 @@ async fn search_with_filter_array_notation() {
|
|||||||
|
|
||||||
let (response, code) = index
|
let (response, code) = index
|
||||||
.search_post(json!({
|
.search_post(json!({
|
||||||
"filter": ["title = Glass"]
|
"filter": ["title = Gläss"]
|
||||||
}))
|
}))
|
||||||
.await;
|
.await;
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
@ -351,7 +351,7 @@ async fn search_with_filter_array_notation() {
|
|||||||
|
|
||||||
let (response, code) = index
|
let (response, code) = index
|
||||||
.search_post(json!({
|
.search_post(json!({
|
||||||
"filter": [["title = Glass", "title = \"Shazam!\"", "title = \"Escape Room\""]]
|
"filter": [["title = Gläss", "title = \"Shazam!\"", "title = \"Escape Room\""]]
|
||||||
}))
|
}))
|
||||||
.await;
|
.await;
|
||||||
assert_eq!(code, 200, "{}", response);
|
assert_eq!(code, 200, "{}", response);
|
||||||
|
Loading…
Reference in New Issue
Block a user