Moved query wrong field test to lib.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m45s

This commit is contained in:
2026-03-01 08:07:05 -05:00
parent 1283139571
commit 1836e4803a
2 changed files with 57 additions and 12 deletions

View File

@@ -594,7 +594,11 @@ impl DocumentFile {
for (field, data) in query.iter() {
let id = match self.docdef.get_field_id(field) {
Ok(fid) => fid,
Err(err) => return Err(err),
Err(mut err) => {
err.add_parent(ErrorID::Field(field.clone()));
err.add_parent(ErrorID::Document(query.doc_name().clone()));
return Err(err);
}
};
if indexed_ids.contains(&id) {
indexed.insert(id, data.clone());
@@ -1449,7 +1453,6 @@ mod document_files {
_ => unreachable!("got {:?}: should have been a reply", action),
}
}
*/
#[test]
fn errors_on_bad_field_name() {
@@ -1475,6 +1478,7 @@ mod document_files {
_ => unreachable!("got {:?}: should have been a error", action),
}
}
*/
#[test]
fn errors_on_bad_field_type_with_index() {