Get the latest tech news
Golden Literal Testing in UTest
uTest is a small unit testing library I maintain that aims for simplicity and convenience. This blog post explores the Golden testing feature newly-added in uTest 0.9.0: why it is necessary, what it does, and how it works internally.
But asserting against other kids of literal data structure is also common: primitives, Tuple s, List s, Map s, case class es, or any combination of these nested within each other. Effectively, for the subset of simple assert s that assertGoldenLiteral is suitable for, it greatly reduces the busy-work of writing and maintaining a test suite. Because PPrint is designed to provide source-equivalent and well-formatted output for the given expression, the updated code can now be compiled and run with that assertGoldenLiteral check passing!
Or read this on Hacker News