Skip to content

booster/unit-tests/Pattern/MatchDispatch: exhaustive dispatch-class grid test for matchTerms#4155

Merged
ehildenb merged 1 commit into
masterfrom
match1-dispatch-grid-test
Jun 15, 2026
Merged

booster/unit-tests/Pattern/MatchDispatch: exhaustive dispatch-class grid test for matchTerms#4155
ehildenb merged 1 commit into
masterfrom
match1-dispatch-grid-test

Conversation

@ehildenb

Copy link
Copy Markdown
Member

One canonical pattern/subject term per Term constructor, crossed over all three match modes: 243 (mode, pattern, subject) cells, each asserting only the MatchResult class (success / decisive failure / indeterminate) against an explicit per-mode 9x9 expectation grid. The grids are the artifact: any change to the match1 dispatch table in Booster.Pattern.Match surfaces as a reviewable grid-cell diff, and the test documents the matcher's entire dispatch policy at a glance. Companion fine-grained tests (MatchEval and friends) continue to pin exact substitutions, failure reasons, and remainders; this module pins only the class.

This is to prepare for a major overhaul here: #4152

…rid test for matchTerms

One canonical pattern/subject term per Term constructor, crossed over all
three match modes: 243 (mode, pattern, subject) cells, each asserting only
the MatchResult class (success / decisive failure / indeterminate) against an
explicit per-mode 9x9 expectation grid. The grids are the artifact: any
change to the match1 dispatch table in Booster.Pattern.Match surfaces as a
reviewable grid-cell diff, and the test documents the matcher's entire
dispatch policy at a glance. Companion fine-grained tests (MatchEval and
friends) continue to pin exact substitutions, failure reasons, and
remainders; this module pins only the class.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ehildenb ehildenb marked this pull request as ready for review June 15, 2026 13:00
@ehildenb ehildenb requested a review from jberthold June 15, 2026 13:00

@jberthold jberthold left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
The pattern/subject terms are rather simple here, interesting cases arise when they aren't (e.g. sort differences, non-empty Map, List and Set matching...) but this seems useful.

@ehildenb ehildenb merged commit eb2da06 into master Jun 15, 2026
11 of 12 checks passed
@ehildenb ehildenb deleted the match1-dispatch-grid-test branch June 15, 2026 13:53
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.

2 participants