pest-parser / pest

The Elegant Parser
https://pest.rs
Apache License 2.0
4.64k stars 261 forks source link

Migration towards snapshot-based testing #661

Open bobbbay opened 2 years ago

bobbbay commented 2 years ago

From the cargo-insta documentation,

Snapshots tests (also sometimes called approval tests) are tests that assert values against a reference value (the snapshot). This is similar to how assert_eq! lets you compare a value against a reference value but unlike simple string assertions, snapshot tests let you test against complex values and come with comprehensive tools to review changes. Snapshot tests are particularly useful if your reference values are very large or change often.

In pest, the reference values are indeed quite large, and change relatively often.

By far, the most popular snapshot-based testing library is cargo-insta, but RA's expect-test also exists.

I do not have the permissions to add labels to this issue, but some labels I would like are good-first-issue and help-wanted.

CAD97 commented 2 years ago

Other potentially useful tools include