Background
PR #259 extracted Expr::to_sexpr() into src/parser/ast/expr/sexpr.rs. The output is a text-based S-expression representation used in parser tests. Currently this output is validated only by inline string assertions; there are no snapshot tests to guard the rendering against regression.
Required work
Introduce snapshot testing for src/parser/ast/expr/sexpr.rs using the insta crate:
- Add
insta as a dev-dependency in Cargo.toml.
- Write snapshot tests covering each
Expr variant rendered by to_sexpr(), using insta::assert_snapshot!.
- Commit the generated
.snap files under src/parser/ast/expr/snapshots/ (or the default insta snapshot directory).
- Confirm
cargo test and cargo insta review pass cleanly.
Rationale
Snapshot tests make regressions in S-expression output immediately visible as diff noise in review, rather than requiring manual comparison of string literals scattered across test functions.
References
Background
PR #259 extracted
Expr::to_sexpr()intosrc/parser/ast/expr/sexpr.rs. The output is a text-based S-expression representation used in parser tests. Currently this output is validated only by inline string assertions; there are no snapshot tests to guard the rendering against regression.Required work
Introduce snapshot testing for
src/parser/ast/expr/sexpr.rsusing theinstacrate:instaas a dev-dependency inCargo.toml.Exprvariant rendered byto_sexpr(), usinginsta::assert_snapshot!..snapfiles undersrc/parser/ast/expr/snapshots/(or the defaultinstasnapshot directory).cargo testandcargo insta reviewpass cleanly.Rationale
Snapshot tests make regressions in S-expression output immediately visible as diff noise in review, rather than requiring manual comparison of string literals scattered across test functions.
References