Stream: contributing

Topic: Parsing Snapshot Test


view this post on Zulip Brendan Hansknecht (Oct 08 2024 at 00:25):

Is there a quick way to update the parsing snapshot tests? I have a few that are failing because I made a change. Sadly, they just print the diff instead of applying it and letting me commit the changes if I agree with them.

view this post on Zulip Brendan Hansknecht (Oct 08 2024 at 00:25):

The tests from -p test_syntax --test test_snapshots

view this post on Zulip Sam Mohr (Oct 08 2024 at 00:26):

My fastest mechanism so far has been to just delete the current file and copy the diff in

view this post on Zulip Sam Mohr (Oct 08 2024 at 00:26):

But I don't know of a "clean" way

view this post on Zulip Brendan Hansknecht (Oct 08 2024 at 00:26):

We should maybe make these work like mono. Where it updates the file and lets you git add ... if you agree with the diff.

view this post on Zulip Sam Mohr (Oct 08 2024 at 00:27):

I agree with that suggestion

view this post on Zulip Luke Boswell (Oct 08 2024 at 05:53):

Isn't there a cargo tool like cargo review or something that does this. I can't check rn I'm on my phone, but last time I looked at it I hadn't noticed the tool was in the error message it said use this to review and approved the new snapshots.

view this post on Zulip Luke Boswell (Oct 08 2024 at 06:48):

I think it was $ cargo insta review

view this post on Zulip Luke Boswell (Oct 08 2024 at 06:50):

Actually I think you're looking for ROC_SNAPSHOT_TEST_OVERWRITE

$ ROC_SNAPSHOT_TEST_OVERWRITE=1 cargo test -p test_syntax --test test_snapshots

view this post on Zulip Joshua Warner (Oct 09 2024 at 14:35):

I’ve been thinking about converting these tests to use cargo insta


Last updated: Jul 06 2025 at 12:14 UTC