gelisam / klister

an implementation of stuck macros
BSD 3-Clause "New" or "Revised" License
128 stars 11 forks source link

Convert the old test suite to golden files #204

Open gelisam opened 1 year ago

gelisam commented 1 year ago

./tests/Test.hs runs three kinds of tests:

  1. In "Expander tests", we expand some programs, we match on the resulting AST, and we check that the results are as expected.
  2. In "Hedgehog tests", we run some property tests.
  3. In "Golden tests", we run all the files in the examples folder, and we check that the results are as expected in the corresponding .golden file.

The golden tests are much more convenient than the expander tests, because the .golden file is created automatically if it is missing. Most of the expander tests, which were written before we had golden tests, can and should be replaced by golden tests. Currently, we only bother migrating an expander test to a golden test when the Klister implementation changes in a way which causes an expander test to fail. It would be nice to get rid of all of them once and for all.