beef331 / website

Code for the official Nim programming language website
https://nim-lang.org
18 stars 1 forks source link

Susta: a print statement based test runner #21

Closed ajusa closed 3 years ago

ajusa commented 3 years ago

Name: Susta

Author: @ajusa

Posting: Susta is a test runner that aids in print statement based testing. You pass it a lists of Nim files to run, and it saves any output from stdout to a file. Then, when you run the tests again, it diffs the output with the saved output and reports any differences. If the changes are what you expected, you can simply accept them to overwrite the old output. It is a simple and easy way to write tests when you can't be bothered to write unit tests. It especially shines when you want to catch regressions.

I plan on making it language agnostic and adding threading support to run tests in parallel in the near future.

It's a super simple utility (https://github.com/ajusa/susta), and I hope folks enjoy using it!