Expand description
Test helpers for the XML engine.
These helpers are intentionally generic and domain-free. They centralize fixture paths, golden file comparisons, and parser/writer roundtrips so modules do not need to duplicate ad-hoc test utilities.
Structs§
- Roundtrip
Result - Result of parsing, serializing, reparsing, and serializing again.
- XmlDiff
- Compact, line-oriented diff for XML golden comparisons.
Constants§
- GOLDEN_
DIR - Repository-relative directory for golden files.
- XML_
FIXTURES_ DIR - Repository-relative directory for XML fixtures.
Functions§
- assert_
compact_ roundtrip - Parses XML, serializes it compactly, reparses it, and verifies stability.
- assert_
compact_ roundtrip_ with_ config - Parses XML with explicit config, serializes compactly, reparses it, and verifies stability.
- assert_
document_ matches_ golden - Serializes a document using an explicit writer configuration and compares it to a golden file.
- assert_
matches_ golden - Reads a golden file and compares it with actual XML output.
- assert_
xml_ eq - Panics with a compact diff when two XML strings differ.
- compare_
xml - Compares XML strings while allowing a single final line ending in fixtures.
- golden_
path - Resolves a golden file path relative to the repository root.
- parse_
xml_ fixture - Parses a fixture from
tests/fixtures/xml. - read_
golden - Reads a golden file from
tests/golden. - read_
utf8_ file - Reads a UTF-8 file and maps filesystem errors to
XmlError. - read_
xml_ fixture - Reads an XML fixture from
tests/fixtures/xml. - repo_
path - Resolves a path relative to the repository root.
- xml_
fixture_ path - Resolves an XML fixture path relative to the repository root.