You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
391: Uses big_S to cleanup tests r=bidoubiwa a=romilpunetha
# Pull Request
## Related issue
Fixes#388
## What does this PR do?
- Adds big_S crate as a dev dependency to be used for tests
## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!
Co-authored-by: Romil Punetha <[email protected]>
Document{id:0,kind:"text".into(),value:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.".to_string(),nested:Nested{child:"first".to_string()}},
418
-
Document{id:1,kind:"text".into(),value:"dolor sit amet, consectetur adipiscing elit".to_string(),nested:Nested{child:"second".to_string()}},
419
-
Document{id:2,kind:"title".into(),value:"The Social Network".to_string(),nested:Nested{child:"third".to_string()}},
420
-
Document{id:3,kind:"title".into(),value:"Harry Potter and the Sorcerer's Stone".to_string(),nested:Nested{child:"fourth".to_string()}},
421
-
Document{id:4,kind:"title".into(),value:"Harry Potter and the Chamber of Secrets".to_string(),nested:Nested{child:"fift".to_string()}},
422
-
Document{id:5,kind:"title".into(),value:"Harry Potter and the Prisoner of Azkaban".to_string(),nested:Nested{child:"sixth".to_string()}},
423
-
Document{id:6,kind:"title".into(),value:"Harry Potter and the Goblet of Fire".to_string(),nested:Nested{child:"seventh".to_string()}},
424
-
Document{id:7,kind:"title".into(),value:"Harry Potter and the Order of the Phoenix".to_string(),nested:Nested{child:"eighth".to_string()}},
425
-
Document{id:8,kind:"title".into(),value:"Harry Potter and the Half-Blood Prince".to_string(),nested:Nested{child:"ninth".to_string()}},
426
-
Document{id:9,kind:"title".into(),value:"Harry Potter and the Deathly Hallows".to_string(),nested:Nested{child:"tenth".to_string()}},
418
+
Document{id:0,kind:"text".into(),value:S("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),nested:Nested{child:S("first")}},
419
+
Document{id:1,kind:"text".into(),value:S("dolor sit amet, consectetur adipiscing elit"),nested:Nested{child:S("second")}},
420
+
Document{id:2,kind:"title".into(),value:S("The Social Network"),nested:Nested{child:S("third")}},
421
+
Document{id:3,kind:"title".into(),value:S("Harry Potter and the Sorcerer's Stone"),nested:Nested{child:S("fourth")}},
422
+
Document{id:4,kind:"title".into(),value:S("Harry Potter and the Chamber of Secrets"),nested:Nested{child:S("fift")}},
423
+
Document{id:5,kind:"title".into(),value:S("Harry Potter and the Prisoner of Azkaban"),nested:Nested{child:S("sixth")}},
424
+
Document{id:6,kind:"title".into(),value:S("Harry Potter and the Goblet of Fire"),nested:Nested{child:S("seventh")}},
425
+
Document{id:7,kind:"title".into(),value:S("Harry Potter and the Order of the Phoenix"),nested:Nested{child:S("eighth")}},
426
+
Document{id:8,kind:"title".into(),value:S("Harry Potter and the Half-Blood Prince"),nested:Nested{child:S("ninth")}},
427
+
Document{id:9,kind:"title".into(),value:S("Harry Potter and the Deathly Hallows"),nested:Nested{child:S("tenth")}},
427
428
],None).await?;
428
429
let t1 = index.set_filterable_attributes(["kind","value"]).await?;
429
430
let t2 = index.set_sortable_attributes(["title"]).await?;
@@ -442,7 +443,7 @@ mod tests {
442
443
443
444
let res = query.execute::<Document>().await.unwrap();
444
445
445
-
assert_eq!(res.query,"space".to_string());
446
+
assert_eq!(res.query,S("space"));
446
447
assert_eq!(res.limit,21);
447
448
assert_eq!(res.offset,42);
448
449
Ok(())
@@ -467,11 +468,9 @@ mod tests {
467
468
assert_eq!(
468
469
&Document{
469
470
id:1,
470
-
value:"dolor sit amet, consectetur adipiscing elit".to_string(),
471
-
kind:"text".to_string(),
472
-
nested:Nested{
473
-
child:"second".to_string()
474
-
}
471
+
value:S("dolor sit amet, consectetur adipiscing elit"),
472
+
kind:S("text"),
473
+
nested:Nested{ child:S("second")}
475
474
},
476
475
&results.hits[0].result
477
476
);
@@ -619,12 +618,9 @@ mod tests {
619
618
assert_eq!(
620
619
&Document{
621
620
id:0,
622
-
value:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do…"
623
-
.to_string(),
624
-
kind:"text".to_string(),
625
-
nested:Nested{
626
-
child:"first".to_string()
627
-
}
621
+
value:S("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do…"),
let results:SearchResults<Document> = index.execute_query(&query).await?;
659
653
assert_eq!(&Document{
660
654
id:0,
661
-
value:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.".to_string(),
662
-
kind:"text".to_string(),
663
-
nested:Nested{ child:"first".to_string()}
655
+
value:S("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
0 commit comments