Skip to content

Rework the E2e case harness into named, typed sections - #91

Merged
MidnightDesign merged 1 commit into
masterfrom
e2e-harness
Jul 23, 2026
Merged

Rework the E2e case harness into named, typed sections#91
MidnightDesign merged 1 commit into
masterfrom
e2e-harness

Conversation

@MidnightDesign

Copy link
Copy Markdown
Contributor

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

E2eCase now parses a case file as an expression plus named sections instead of a fixed source + Output (+ Input) shape:

  • Output — a literal the expression must evaluate to (with Input supplying 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 Declarations and an optional E2eError instead of a bare expected value. 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.

Why it's safe to land first

The new sections are wired into nothing yet — every existing fixture uses only Input/Output/Types and stays green. No production code changes. Locally: phpunit (1030 tests), cs-check, psalm, phpstan, composer-require-checker, and infection --git-diff-lines all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XaVJhFFYHJee3UokQwFG6E

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
MidnightDesign merged commit 261a316 into master Jul 23, 2026
25 checks passed
@MidnightDesign
MidnightDesign deleted the e2e-harness branch July 23, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant