Skip to main content

Crate text_document_test_harness

Crate text_document_test_harness 

Source
Expand description

Shared test setup utilities for text-document crate tests.

Provides helpers to create an in-memory document with content, export text, and traverse the entity tree. This crate depends only on common and direct_access — it reimplements plain-text import and export directly via entity controllers, so it does not depend on document_io or any feature crate, breaking the circular dev-dependency chain.

Modules§

block_controller
document_controller
frame_controller
inline_element_controller
root_controller

Structs§

BasicStats
Basic document statistics retrieved directly from entity data.
CreateBlockDto
CreateDocumentDto
CreateFrameDto
CreateInlineElementDto
CreateRootDto

Enums§

BlockRelationshipField
DocumentRelationshipField
FrameRelationshipField
RootRelationshipField

Functions§

export_text
Export the current document as plain text by reading blocks and concatenating their plain_text fields with \n separators.
get_block_ids
Get the first frame’s block IDs.
get_document_stats
Get basic document statistics by reading the Document entity directly.
get_element_ids
Get the element IDs for a given block.
get_first_block_element_ids
Get the first block’s element IDs.
get_frame_id
Get the first frame ID for the document.
setup
Create an in-memory database with a Root and empty Document.
setup_with_text
Create an in-memory database with a Root, Document, and imported text content.