test(engine): lock chained explore resume after DigChoice (#1151)#3740
test(engine): lock chained explore resume after DigChoice (#1151)#3740kiannidev wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a unit test to crates/engine/src/game/effects/explore.rs to verify that chained explore abilities resume correctly after a nonland DigChoice resolves. The feedback suggests optimizing the test by matching on a reference to state.waiting_for instead of cloning it, which avoids unnecessary heap allocations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| "first explore should add one +1/+1 counter" | ||
| ); | ||
|
|
||
| let WaitingFor::DigChoice { cards, .. } = state.waiting_for.clone() else { |
There was a problem hiding this comment.
[MEDIUM] Avoid unnecessary cloning of WaitingFor by matching on a reference.
Why it matters: WaitingFor is a large enum containing heap-allocated collections (like Vec<ObjectId> and Vec<String>). Cloning it just to extract a single ObjectId from the cards vector is inefficient.
Suggested fix: Match on &state.waiting_for instead of state.waiting_for.clone().
| let WaitingFor::DigChoice { cards, .. } = state.waiting_for.clone() else { | |
| let WaitingFor::DigChoice { cards, .. } = &state.waiting_for else { |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
VERDICT: approve-pending-CI Reviewed head The regression is at the right seam: it drives Holding formal approval/enqueue until CI is green on the pushed head and the branch is brought current / passes the normal repush guard. |
matthewevans
left a comment
There was a problem hiding this comment.
Approved after re-review of the current head: this is a test-only regression at the chained explore/DigChoice resume seam, the required test label is present, and GitHub checks are green at 81e137c075b00d3644a5cd7ce8ba7d1666d832a8.
Summary
Exploreresumes only after the first explore's nonlandDigChoicecompletes (Jadelight Ranger pattern).Test plan
cargo test -p engine --lib chained_explore_resumesFixes #1151