Rework the E2e case harness into named, typed sections - #91
Merged
Conversation
Split from #88. E2eCase now parses a case file as an expression plus named sections -- Output, Expression type, Types, Functions, Syntax error, Type error, Note -- rather than a fixed source + Output (+ Input) shape. It validates the section names, so a typo is a failure rather than a case that quietly stops asserting; carries a Declarations (aliases and declared function signatures) and an optional E2eError instead of a bare expected value; and lets a case assert an evaluated Output, an Expression type, or an exact error message. EndToEndTest runs each case only as far as the sections it writes reach: an error case stops at the parse, a type case never evaluates. ParsesTypeSyntax wraps TypeParser's two @internal entry points in one place. The new sections are wired into nothing yet: every existing fixture uses only Input/Output/Types and stays green, so this lands ahead of the generics feature that fills them in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaVJhFFYHJee3UokQwFG6E
MidnightDesign
force-pushed
the
e2e-harness
branch
from
July 23, 2026 13:40
a14c917 to
576bc4a
Compare
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.
Split from #88.
Peels the test-only E2e harness rework out of the generics branch so it can land on its own, ahead of the feature that uses it.
What changes
E2eCasenow parses a case file as an expression plus named sections instead of a fixedsource+Output(+Input) shape:Output— a literal the expression must evaluate to (withInputsupplying variables).Expression type— the printed type the expression must have.Syntax error/Type error— the exact message the source must be rejected with.Types— aliases in scope;Functions— declared call signatures.Note— asserts nothing; records why a case exists.Section names are validated against an allowlist, so a typo becomes a failure rather than a case that quietly stops asserting. A case carries a
Declarationsand an optionalE2eErrorinstead of a bare expected value.EndToEndTestruns each case only as far as the sections it writes reach: an error case stops at the parse, a type case never evaluates.ParsesTypeSyntaxwrapsTypeParser's two@internalentry points in one place.Why it's safe to land first
The new sections are wired into nothing yet — every existing fixture uses only
Input/Output/Typesand stays green. No production code changes. Locally:phpunit(1030 tests),cs-check,psalm,phpstan,composer-require-checker, andinfection --git-diff-linesall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01XaVJhFFYHJee3UokQwFG6E