support S-expression output comparison for the tester
the first line of an .expected file being ;$sexp marks it as
containing S-expressions
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.
Summary
.expected
file being;$sexp
marks it as containing S-expressionsDetails
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. Sincesexp.parseSexp
doesn't support parsing more than one S-expression from a stream, a custom parser based onSexpParser
has to be used.The existing
.expected
files containing S-expressions are marked as such.