Removed warnings from query tests.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
@@ -2,7 +2,7 @@ mod support;
|
||||
|
||||
use morethantext::{
|
||||
Action, CalcValue, Calculation, DocDef, ErrorID, Field, FieldType, Include, IndexType,
|
||||
MTTError, MoreThanText, Name, Operand, Path, Query, TestMoreThanText,
|
||||
MTTError, MoreThanText, Name, Operand, Path, Query,
|
||||
};
|
||||
use std::collections::HashSet;
|
||||
use support::{setup_range, TestDocument};
|
||||
@@ -12,9 +12,9 @@ const COUNT: usize = 5;
|
||||
#[test]
|
||||
fn does_empty_query_get_all_documents() {
|
||||
let (test_env, test_doc) = setup_range(COUNT);
|
||||
let mut mtt = test_env.get_morethantext();
|
||||
let mtt = test_env.get_morethantext();
|
||||
let client = mtt.client();
|
||||
let mut query = Query::new(test_doc.get_doc_name());
|
||||
let query = Query::new(test_doc.get_doc_name());
|
||||
let result = client.records(query).unwrap();
|
||||
assert_eq!(result.len(), 5, "got {:?}", result);
|
||||
let mut holder: HashSet<Field> = HashSet::new();
|
||||
@@ -32,7 +32,7 @@ fn does_empty_query_get_all_documents() {
|
||||
#[test]
|
||||
fn does_query_pull_specific_information() {
|
||||
let (test_env, test_doc) = setup_range(COUNT);
|
||||
let mut mtt = test_env.get_morethantext();
|
||||
let mtt = test_env.get_morethantext();
|
||||
let client = mtt.client();
|
||||
let expected = 3;
|
||||
let mut calc = Calculation::new(Operand::Equal);
|
||||
@@ -53,7 +53,7 @@ fn does_query_pull_specific_information() {
|
||||
#[test]
|
||||
fn does_query_work_with_less_than() {
|
||||
let (test_env, test_doc) = setup_range(COUNT);
|
||||
let mut mtt = test_env.get_morethantext();
|
||||
let mtt = test_env.get_morethantext();
|
||||
let client = mtt.client();
|
||||
let expected = 2;
|
||||
let mut calc = Calculation::new(Operand::LessThan);
|
||||
@@ -79,7 +79,7 @@ fn does_query_work_with_less_than() {
|
||||
#[test]
|
||||
fn does_query_work_with_less_than_equal() {
|
||||
let (test_env, test_doc) = setup_range(COUNT);
|
||||
let mut mtt = test_env.get_morethantext();
|
||||
let mtt = test_env.get_morethantext();
|
||||
let client = mtt.client();
|
||||
let expected = 2;
|
||||
let mut calc = Calculation::new(Operand::LessThanEqual);
|
||||
@@ -105,7 +105,7 @@ fn does_query_work_with_less_than_equal() {
|
||||
#[test]
|
||||
fn does_query_work_with_greater_than() {
|
||||
let (test_env, test_doc) = setup_range(COUNT);
|
||||
let mut mtt = test_env.get_morethantext();
|
||||
let mtt = test_env.get_morethantext();
|
||||
let client = mtt.client();
|
||||
let expected = 2;
|
||||
let mut calc = Calculation::new(Operand::GreaterThan);
|
||||
@@ -130,7 +130,7 @@ fn does_query_work_with_greater_than() {
|
||||
#[test]
|
||||
fn does_query_work_with_greater_than_equal() {
|
||||
let (test_env, test_doc) = setup_range(COUNT);
|
||||
let mut mtt = test_env.get_morethantext();
|
||||
let mtt = test_env.get_morethantext();
|
||||
let client = mtt.client();
|
||||
let expected = 2;
|
||||
let mut calc = Calculation::new(Operand::GreaterThanEqual);
|
||||
@@ -154,7 +154,7 @@ fn does_query_work_with_greater_than_equal() {
|
||||
|
||||
#[test]
|
||||
fn can_query_use_multiple_fields() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let mtt = MoreThanText::new();
|
||||
let client = mtt.client();
|
||||
let test_doc = TestDocument::new(vec![FieldType::StaticString, FieldType::StaticString]);
|
||||
client.create_document(test_doc.get_docdef()).unwrap();
|
||||
@@ -187,7 +187,7 @@ fn can_query_use_multiple_fields() {
|
||||
|
||||
#[test]
|
||||
fn can_query_use_multiple_indexed_fields() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let mtt = MoreThanText::new();
|
||||
let client = mtt.client();
|
||||
let test_doc = TestDocument::new(vec![FieldType::StaticString, FieldType::StaticString]);
|
||||
let mut docdef = test_doc.get_docdef();
|
||||
@@ -227,7 +227,7 @@ fn can_query_use_multiple_indexed_fields() {
|
||||
|
||||
#[test]
|
||||
fn can_query_use_multiple_mixed_index_fields() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let mtt = MoreThanText::new();
|
||||
let client = mtt.client();
|
||||
let test_doc = TestDocument::new(vec![FieldType::StaticString, FieldType::StaticString]);
|
||||
let mut docdef = test_doc.get_docdef();
|
||||
@@ -264,12 +264,12 @@ fn can_query_use_multiple_mixed_index_fields() {
|
||||
|
||||
#[test]
|
||||
fn does_it_error_on_bad_field_name() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let mtt = MoreThanText::new();
|
||||
let client = mtt.client();
|
||||
let doc_name = Name::english("holder");
|
||||
let field_name = Name::english("missing");
|
||||
let docdef = DocDef::new(doc_name.clone());
|
||||
client.create_document(docdef);
|
||||
client.create_document(docdef).unwrap();
|
||||
let mut calc = Calculation::new(Operand::Equal);
|
||||
calc.add_value("a").unwrap();
|
||||
calc.add_value(CalcValue::Existing(FieldType::StaticString))
|
||||
@@ -285,10 +285,10 @@ fn does_it_error_on_bad_field_name() {
|
||||
|
||||
#[test]
|
||||
fn does_it_error_on_bad_field_type() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let mtt = MoreThanText::new();
|
||||
let client = mtt.client();
|
||||
let test_doc = TestDocument::new(vec![FieldType::Uuid]);
|
||||
client.create_document(test_doc.get_docdef());
|
||||
client.create_document(test_doc.get_docdef()).unwrap();
|
||||
let mut calc = Calculation::new(Operand::Equal);
|
||||
calc.add_value("a").unwrap();
|
||||
calc.add_value(CalcValue::Existing(FieldType::StaticString))
|
||||
@@ -306,7 +306,7 @@ fn does_it_error_on_bad_field_type() {
|
||||
fn does_query_send_on_query_message() {
|
||||
let selected = 2;
|
||||
let (mut test_env, test_doc) = setup_range(3);
|
||||
let mut mtt = test_env.get_morethantext();
|
||||
let mtt = test_env.get_morethantext();
|
||||
let client = mtt.client();
|
||||
test_env.register_channel(vec![Path::new(
|
||||
Include::All,
|
||||
|
||||
Reference in New Issue
Block a user