From 7d73f72e8360dc96008866426ecbcbb6660be8bc Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 25 May 2025 11:36:34 +0400 Subject: [PATCH] tests: enabled some verify tests --- .../java/mage/verify/VerifyCardDataTest.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index c3fbd4cb9af..7e54218dae4 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -308,9 +308,6 @@ public class VerifyCardDataTest { check(((CardWithHalves) card).getLeftHalfCard(), cardIndex); check(((CardWithHalves) card).getRightHalfCard(), cardIndex); } else if (card instanceof CardWithSpellOption) { - if (card.isLand()) { // temporary until scryfall fixes the mana cost issue for adventure lands - continue; - } check(card, cardIndex); check(((CardWithSpellOption) card).getSpellCard(), cardIndex); } else { @@ -1129,9 +1126,6 @@ public class VerifyCardDataTest { } for (ExpansionSet.SetCardInfo card : set.getSetCardInfo()) { - if (OmenCard.class.isAssignableFrom(card.getCardClass())) { // temporary until mtgjson fixed - continue; - } boolean cardHaveDoubleName = (doubleNames.getOrDefault(card.getName(), 0) > 1); boolean cardHaveVariousSetting = card.getGraphicInfo() != null && card.getGraphicInfo().getUsesVariousArt(); @@ -1729,13 +1723,17 @@ public class VerifyCardDataTest { return; } + // TODO: temporary fix - scryfall/mtgjson wrongly add [colors, mana cost] from spell part to main part/card, + // example: Ishgard, the Holy See // Faith & Grief + if (card instanceof CardWithSpellOption && card.isLand() + || card instanceof SpellOptionCard && ((SpellOptionCard) card).getParentCard().isLand()) { + return; + } + Set expected = new HashSet<>(); if (ref.colors != null) { expected.addAll(ref.colors); } - if (card.isFlipCard()) { - expected.addAll(ref.colorIdentity); - } ObjectColor color = card.getColor(null); @@ -2174,7 +2172,7 @@ public class VerifyCardDataTest { // - it's can be a keyword action (only mtg rules contains a target word), so add it to the targetedKeywords // * on "must be targeted": // - TODO: enable and research checkMissTargeted - too much errors with it (is it possible to use that checks?) - boolean checkMissNonTargeted = !(card instanceof OmenCard); // must set withNotTarget(true) temporarily set to ignore omen cards + boolean checkMissNonTargeted = true; // must set withNotTarget(true) boolean checkMissTargeted = false; // must be targeted List targetedKeywords = Arrays.asList( "target", @@ -2184,9 +2182,10 @@ public class VerifyCardDataTest { "modular", "partner" ); - // card can contain rules text from both sides, so must search ref card for all sides too + // xmage card can contain rules text from both sides, so must search ref card for all sides too String additionalName; - if (card instanceof AdventureCard) { // temporary to prevent failure due to upstream error + if (card instanceof CardWithSpellOption) { + // adventure/omen cards additionalName = ((CardWithSpellOption) card).getSpellCard().getName(); } else if (card.isTransformable() && !card.isNightCard()) { additionalName = card.getSecondCardFace().getName(); @@ -2204,6 +2203,7 @@ public class VerifyCardDataTest { } } } + boolean needTargetedAbility = targetedKeywords.stream().anyMatch(refLowerText::contains); boolean foundTargetedAbility = card.getAbilities() .stream() @@ -2883,6 +2883,13 @@ public class VerifyCardDataTest { return; } + // TODO: temporary fix - scryfall/mtgjson wrongly add [colors, mana cost] from spell part to main part/card, + // example: Ishgard, the Holy See // Faith & Grief + if (card instanceof CardWithSpellOption && card.isLand() + || card instanceof SpellOptionCard && ((SpellOptionCard) card).getParentCard().isLand()) { + return; + } + String expected = ref.manaCost; String cost = String.join("", card.getManaCostSymbols()); if (cost.isEmpty()) {