test: remove shallow parse-only smoke tests from compile.test.ts (#72)#148
Merged
Merged
Conversation
These 82 tests each parsed a snippet and asserted only `ast` defined + `errors` empty — no AST-structure or codegen assertions. The constructs they touch (arithmetic/comparison/logical operators, control flow, literals, variable/type declarations, multi-POU) are all exercised far more rigorously by the codegen-*.test.ts and cpp-compile/st-validation suites, which parse *and* generate *and* assert real C++ output. A parse-only "no errors" check is strictly weaker and adds no coverage those provide. Removed in full: Function/FB Parsing, Expression Parsing, Chained Expression, Literal Types, Direct Address, Type Declaration, Additional Expression Edge Cases, Multiple POU, Variable Declaration, Control Flow Parsing, Edge Case. Trimmed: Parse Function Tests and Complex Program Tests keep only their non-shallow cases. Deliberately KEPT (not shallow): the negative test (`returns errors for invalid syntax`), the empty-input edge test, and the compile()-based VAR_GLOBAL/VAR_EXTERNAL success test. Supersedes #79, which missed the two function-parsing sections (they sit before its "keep first 536 lines" cutoff) and over-removed the compile()-based Complex Program test. 136 -> 54 tests; full suite green (1917 passed), typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #72. Removes 82 shallow parse-only smoke tests from
tests/integration/compile.test.ts. Each only did:— no AST-structure or codegen assertions. The constructs they touch (arithmetic/comparison/logical operators, control flow, literals, variable/type declarations, multi-POU) are exercised far more rigorously by the
codegen-*.test.tsandcpp-compile/st-validationsuites, which parse and generate and assert real C++ output. A parse-only "no errors" check is strictly weaker and adds nothing those provide.136 → 54tests in the file; full suite green (1917 passed, down exactly 82), typecheck clean. Diff is deletion-only (no quote/format churn —tests/isn't covered byprettier --check src/).Why this supersedes #79
I classified every
it()in the current file. PR #79 (March, line-range based) was both incomplete and slightly over-broad:Parse Function Tests(5 shallow) andFunction and Function Block Parsing Tests(4 shallow) — which sit before its "keep first 536 lines" cutoff but are shallow too.Complex Program Testssection, including a meaningfulcompile()+success test.What was removed vs. kept
Removed in full: Function/FB Parsing, Expression Parsing, Chained Expression, Literal Types, Direct Address, Type Declaration, Additional Expression Edge Cases, Multiple POU, Variable Declaration, Control Flow Parsing, Edge Case.
Trimmed (kept the non-shallow cases):
Parse Function Tests→ keptshould return errors for invalid syntax(negative test) andshould parse empty input(edge/contract).Complex Program Tests→ keptshould parse configuration with VAR_GLOBAL and programs with VAR_EXTERNAL(compile()+ success).Untouched meaningful sections: Project Structure, Error Handling, Compiler Options, External Code Pragma, Future Integration.
🤖 Generated with Claude Code