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 — eliminating the need for each feature crate to depend on direct_access and document_io in its dev-dependencies.

Modules§

block_controller
document_controller
document_io_controller
frame_controller
inline_element_controller
root_controller

Structs§

BasicStats
Basic document statistics retrieved directly from entity data.
CreateDocumentDto
CreateRootDto
ImportPlainTextDto

Enums§

BlockRelationshipField
DocumentRelationshipField
FrameRelationshipField
RootRelationshipField

Functions§

export_text
Export the current document as plain text.
get_block_ids
Get the first frame’s block IDs (sorted by document_position).
get_document_stats
Get basic document statistics by reading the Document entity directly — avoids depending on the document_inspection crate.
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.