nim-works / phy

compiler and vm experiments
MIT License
3 stars 2 forks source link

tester: support S-expr output comparison #22

Closed zerbina closed 2 months ago

zerbina commented 2 months ago

Summary

Details

While parsing and comparing S-expression is less efficient than a pure string comparison, it does improve ergonomics of writing tests, as the formatting of .expected files becomes irrelevant.

The ;$sexp prefix was chosen because it's something that's unlikely to ever appears at the start of a runner's output. Since sexp.parseSexp doesn't support parsing more than one S-expression from a stream, a custom parser based on SexpParser has to be used.

The existing .expected files containing S-expressions are marked as such.