I've been using a 'golden tests' library for testing my parser, and it's just delightful. Rather than writing a verbose assertion about the resulting AST, I can just re-run my tests until the output looks good!
I'm using https://github.com/jfecher/golden-tests currently, which can automatically update the output in the file.
Example commit:
miniblog.
Related Posts
I'm still experimenting with UIs for live (sandboxed) evaluation of tests. I've realised that you really want to highlight the failing assertion, not just the failing test.
Feedback welcome :)
I've been using a 'golden tests' library for testing my parser, and it's just delightful. Rather than writing a verbose assertion about the resulting AST, I can just re-run my tests until the output looks good!
Got a bug report on difftastic saying it crashes with an error: "should be impossible: expected XYZ".
I am very glad I phrased my assertion as *should*!