Skip to main content

Crate diagprint_test

Crate diagprint_test 

Source
Expand description

Testing helpers for diagprint.

diagprint-test provides focused assertions, canonical identity checks, and deterministic snapshot helpers over structured diagnostics and diagnostic reports without depending on rendered terminal output.

The helpers intentionally inspect diagprint’s public structured model rather than parsing presentation formats.

Modules§

prelude
Common imports for tests using diagprint-test.

Macros§

assert_diagnostic_file_snapshot
Asserts that a diagnostic matches a JSON snapshot file.
assert_diagnostic_snapshot
Asserts that a diagnostic matches an inline JSON snapshot.
assert_report_file_snapshot
Asserts that a diagnostic report matches a JSON snapshot file.
assert_report_snapshot
Asserts that a diagnostic report matches an inline JSON snapshot.

Constants§

SNAPSHOT_IGNORED_FIELDS
Runtime-specific diagnostic fields deliberately excluded from stable snapshots.

Traits§

DiagnosticAssertions
Assertion helpers for one Diagnostic.
DiagnosticCanonicalAssertions
Canonical identity assertions for one Diagnostic.
DiagnosticDeltaAssertions
Assertions over a semantic DiagnosticDelta.
DiagnosticReportAssertions
Assertion helpers for DiagnosticReport.
DiagnosticReportCanonicalAssertions
Canonical digest assertions for DiagnosticReport.

Functions§

assert_diagnostic_matches_snapshot
Compares one diagnostic against an expected JSON snapshot.
assert_report_matches_snapshot
Compares one report against an expected JSON snapshot.
diagnostic_snapshot
Produces stable, pretty-printed JSON for one diagnostic.
report_snapshot
Produces stable, pretty-printed JSON for a diagnostic report.