Skip to main content

assert_diagnostic

Macro assert_diagnostic 

Source
macro_rules! assert_diagnostic {
    ($output:expr, $level:expr, $msg:expr) => { ... };
}
Expand description

Asserts that an Output contains a diagnostic at the given level whose Display output contains the expected substring.

Walks all nested diagnostics (via Diagnostic::walk()) to find a match.

§Examples

let output = zyn::Render::render(&my_element, &input);
zyn::assert_diagnostic!(output, zyn::mark::Level::Error, "field not found");