Repository navigation
fix(pattern): JS subtree of a max-depth path is the path itself - #4360
Conversation
Mirror #4284 in @moq/pattern: Pattern.subtree no longer appends ** to a 32-segment path, which overflowed the segment limit. Add max-depth and over-depth subtree cases to the shared vectors so Rust and JS both test it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
MERGE Positive improvement: Worth the complexity: yes — tiny, local change. Append Different approach: none better. Mirroring Checks were still pending at review time; merge once CI is green. This is an automated review, not the maintainer's decision |
Delete the quest and its m1 entry. Drop the Rust unit-test copy of the max-depth subtree case now that the shared vector covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge summary
(Written by Opus 5.5) |
Problem
#4284 fixed Rust so
Pattern::subtreeof a 32-segment (MAX_SEGMENTS) path returns the literal instead of appending**and overflowing the limit.@moq/patternwas not mirrored, soPattern.subtreestill throwstoo-many-segmentsfor a max-depth path. The shared vectors had no case for it, so the drift went unnoticed.Approach
js/pattern:Pattern.subtreeappends**only when the path has fewer thanMAX_SEGMENTSsegments, matching Rust.rs/moq-pattern/tests/pattern.json: add a 32-segment subtree case (yields the literal) and a 33-segment case (too-many-segments). Both harnesses now accept anerroron subtree vectors, likeliteral. The new vector fails on JS without the fix.$commentthat still namedmoq-net/js/net.Impact
Pattern.subtree(JS) returns the literal for a 32-segment path instead of throwing. No signature change.Alternatives
None; this is a straight mirror of #4284.
Follow-ups
None.
Completes and deletes
quest/m1/js-pattern-depth.md.(Written by Opus 5.5)
🤖 Generated with Claude Code