Skip to main content

compare_doc_string

Function compare_doc_string 

Source
pub fn compare_doc_string(
    returned: Option<&Value>,
    content: &str,
    span: Span,
) -> Result<Option<CellDiff>, StepError>
Expand description

Compares a doc-string step’s return against the fence body (exact equality, trailing newline included).

A doc string is ONE CELL, compared whole, so a difference is an ordinary CellDiff and the executor raises the same StepError::CellMismatch as any other cell. expected/actual are quoted: a doc string routinely differs only in whitespace, and bare text would render a missing trailing newline as no difference at all.

None → no check. A non-string return → StepError::ReturnShape.