test(engine): verify Land Grant's reveal-hand alternative cost#5354
Merged
matthewevans merged 1 commit intoJul 8, 2026
Merged
Conversation
…-rs#1098) Land Grant ("If you have no land cards in hand, you may reveal your hand rather than pay this spell's mana cost.") reports the alt-cost as non-functional. Traced the full production chain: the parser already emits an EffectCost(RevealHand) casting option gated by a Not(ZoneCoreTypeCardCountAtLeast{Hand, Land, 1}) condition, and payable_spell_alternative_cost_details already evaluates that exact condition shape correctly (see the pre-existing zone_core_type_card_count_condition_checks_hand_card_types unit test in restrictions.rs). The one gap was an end-to-end runtime test for this specific card's condition+cost combination, following the Ravenous Trap precedent immediately above in this file. Adds two tests driving the real payable_spell_alternative_cost_details / can_cast_object_now production seam: - with no land cards in hand, the alt-cost is offered and the spell is castable with zero mana available - with a land card in hand, the alt-cost is withheld and the spell is not castable without mana (hostile fixture for an inverted/ignored gate) No production code change needed — already correct on current main.
Contributor
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
matthewevans
approved these changes
Jul 8, 2026
matthewevans
left a comment
Member
There was a problem hiding this comment.
Clean test-only coverage PR. I verified the diff is limited to casting tests, the new assertions exercise the parsed Land Grant alternative-cost condition through payable_spell_alternative_cost_details and can_cast_object_now, and there are no actionable review comments.
Parse changes introduced by this PR✓ No card-parse changes detected. |
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.
Summary
Closes the verification gap on #1098 (Land Grant: "Alternative cost - show hand with no land cards - doesn't work").
Verified Oracle text via Scryfall: "If you have no land cards in hand, you may reveal your hand rather than pay this spell's mana cost. Search your library for a Forest card, reveal that card, put it into your hand, then shuffle." ({1}{G})
Traced the full production chain:
EffectCost(RevealHand)casting option gated by aNot(ZoneCoreTypeCardCountAtLeast{Hand, Land, 1})condition (existing parser testland_grant_reveal_hand_alternative_cost_option).payable_spell_alternative_cost_details→restrictions::evaluate_conditionalready handles that exact condition shape correctly (existing unit testzone_core_type_card_count_condition_checks_hand_card_types).payable_spell_alternative_cost_details) already has full runtime coverage for Ravenous Trap, immediately above incasting_tests.rs.The one genuine gap was an end-to-end test for this card's specific condition+cost combination. Added two tests driving the real
payable_spell_alternative_cost_details/can_cast_object_nowproduction seam:No production code change was needed — Land Grant's alternative cost already works correctly on current
main.Test plan
land_grant_alt_cost_offered_with_no_lands_in_handandland_grant_alt_cost_not_offered_with_land_in_handpassgame::casting::testsmodule re-run clean: 655 passed, 0 failed, 0 regressionsorigin/main(includes fix(engine): cast/played permanents you don't own enter under your control (#696) #5349)🤖 Generated with Claude Code
https://claude.ai/code/session_01DMa6DrxXyFHBdGxz3uLgvM