logoalt Hacker News

Storment33today at 1:54 AM1 replyview on HN

It is called snapshot testing, very valid technique. Maybe not best suited to a mathematical function like they have here, but I have found it useful for stuff like compilers asserting on the AST, where it would be a pain to write out and assert on the output and may also change shape.


Replies

xenophonftoday at 3:59 AM

TIL. That looks like a nice way to add tests to legacy code without having to re-create what TDD would have had the developers started that way.

show 1 reply