Moved bad query type test.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 0s

This commit is contained in:
2026-03-01 09:39:01 -05:00
parent 1836e4803a
commit 224096cbdb
3 changed files with 67 additions and 3 deletions

View File

@@ -279,3 +279,21 @@ fn does_it_error_on_bad_field_name() {
let result = mtt.records(qry).unwrap_err();
assert_eq!(result.to_string(), expected.to_string());
}
#[test]
fn does_it_error_on_bad_field_type() {
let mut mtt = MoreThanText::new();
let test_doc = TestDocument::new(vec![FieldType::Uuid]);
mtt.create_document(test_doc.get_docdef());
let mut calc = Calculation::new(Operand::Equal);
calc.add_value("a").unwrap();
calc.add_value(CalcValue::Existing(FieldType::StaticString))
.unwrap();
let mut qry = Query::new(test_doc.get_doc_name());
qry.add(test_doc.get_field_name(0), calc);
let mut expected = MTTError::new(ErrorID::FieldTypeExpected(FieldType::Uuid));
expected.add_parent(ErrorID::Field(test_doc.get_field_name(0).into()));
expected.add_parent(ErrorID::Document(test_doc.get_doc_name().clone().into()));
let result = mtt.records(qry).unwrap_err();
assert_eq!(result.to_string(), expected.to_string());
}