llm
Download

testparse

NameModifiedLinesSize
README.md 23 lines6% of this folder's lines 1.1 KiB7% of this folder's bytes
containers.tm 10 lines3% of this folder's lines 236 B1% of this folder's bytes
containers.tm.parse 1 line<1% of this folder's lines 772 B5% of this folder's bytes
control_flow.tm 17 lines5% of this folder's lines 253 B2% of this folder's bytes
control_flow.tm.parse 1 line<1% of this folder's lines 649 B4% of this folder's bytes
definition_flags.tm 31 lines9% of this folder's lines 916 B6% of this folder's bytes
definition_flags.tm.parse 1 line<1% of this folder's lines 1.5 KiB9% of this folder's bytes
err_bad_int_literal.tm 4 lines1% of this folder's lines 178 B1% of this folder's bytes
err_bad_int_literal.tm.parse 9 lines3% of this folder's lines 124 B<1% of this folder's bytes
err_dangling_minus.tm 3 lines<1% of this folder's lines 53 B<1% of this folder's bytes
err_dangling_minus.tm.parse 9 lines3% of this folder's lines 129 B<1% of this folder's bytes
err_dedented_else.tm 5 lines1% of this folder's lines 61 B<1% of this folder's bytes
err_dedented_else.tm.parse 10 lines3% of this folder's lines 150 B<1% of this folder's bytes
err_func_colon.tm 2 lines<1% of this folder's lines 59 B<1% of this folder's bytes
err_func_colon.tm.parse 9 lines3% of this folder's lines 209 B1% of this folder's bytes
err_missing_operand.tm 2 lines<1% of this folder's lines 25 B<1% of this folder's bytes
err_missing_operand.tm.parse 9 lines3% of this folder's lines 148 B<1% of this folder's bytes
err_spaced_minus.tm 4 lines1% of this folder's lines 167 B1% of this folder's bytes
err_spaced_minus.tm.parse 9 lines3% of this folder's lines 143 B<1% of this folder's bytes
err_struct_missing_braces.tm 2 lines<1% of this folder's lines 43 B<1% of this folder's bytes
err_struct_missing_braces.tm.parse 9 lines3% of this folder's lines 170 B1% of this folder's bytes
err_unclosed_bracket.tm 2 lines<1% of this folder's lines 30 B<1% of this folder's bytes
err_unclosed_bracket.tm.parse 8 lines2% of this folder's lines 134 B<1% of this folder's bytes
err_unclosed_paren.tm 3 lines<1% of this folder's lines 51 B<1% of this folder's bytes
err_unclosed_paren.tm.parse 9 lines3% of this folder's lines 173 B1% of this folder's bytes
err_unclosed_table.tm 2 lines<1% of this folder's lines 41 B<1% of this folder's bytes
err_unclosed_table.tm.parse 8 lines2% of this folder's lines 144 B<1% of this folder's bytes
err_use_without_name.tm 3 lines<1% of this folder's lines 25 B<1% of this folder's bytes
err_use_without_name.tm.parse 9 lines3% of this folder's lines 119 B<1% of this folder's bytes
functions.tm 12 lines3% of this folder's lines 217 B1% of this folder's bytes
functions.tm.parse 1 line<1% of this folder's lines 550 B3% of this folder's bytes
lambdas.tm 5 lines1% of this folder's lines 112 B<1% of this folder's bytes
lambdas.tm.parse 1 line<1% of this folder's lines 442 B3% of this folder's bytes
literals.tm 11 lines3% of this folder's lines 154 B<1% of this folder's bytes
literals.tm.parse 1 line<1% of this folder's lines 312 B2% of this folder's bytes
negation.tm 50 lines14% of this folder's lines 1.1 KiB7% of this folder's bytes
negation.tm.parse 1 line<1% of this folder's lines 1.5 KiB9% of this folder's bytes
optionals.tm 6 lines2% of this folder's lines 114 B<1% of this folder's bytes
optionals.tm.parse 1 line<1% of this folder's lines 340 B2% of this folder's bytes
precedence.tm 16 lines4% of this folder's lines 377 B2% of this folder's bytes
precedence.tm.parse 1 line<1% of this folder's lines 739 B4% of this folder's bytes
semicolon_statements.tm 6 lines2% of this folder's lines 219 B1% of this folder's bytes
semicolon_statements.tm.parse 1 line<1% of this folder's lines 268 B2% of this folder's bytes
struct_enum.tm 18 lines5% of this folder's lines 431 B3% of this folder's bytes
struct_enum.tm.parse 1 line<1% of this folder's lines 1003 B6% of this folder's bytes
text_interpolation.tm 13 lines4% of this folder's lines 315 B2% of this folder's bytes
text_interpolation.tm.parse 1 line<1% of this folder's lines 358 B2% of this folder's bytes

README.md

Parser tests

Snapshot tests for the parser. Each foo.tm here is parsed by tomo parse, and its combined stdout and stderr is compared against foo.tm.parse.

A snapshot holds one of two things, and the runner doesn't distinguish them:

  • for a well-formed fixture, the parse tree as an S-expression;
  • for an err_*.tm fixture, which is malformed on purpose, the full text of the parse error.

Because the two are interchangeable, a file that unexpectedly stops parsing, or one that unexpectedly starts, fails against its snapshot either way. The error snapshots also pin the caret span, which nothing else tests: a caret that drifts to the wrong characters breaks no other test in the suite.

Run them with make test-parse. After a deliberate change to the parser or to a diagnostic, make regen-parse-tests rewrites every snapshot from current behavior. It cannot tell a fixed bug from a newly introduced one, so read git diff test/parse before committing the result.

These files are deliberately left out of make test-format: the err_*.tm fixtures don't parse, so the formatter can't round-trip them.