tests: enabled some verify tests

This commit is contained in:
Oleg Agafonov 2025-05-25 11:36:34 +04:00
parent 2f35eb7fa6
commit 7d73f72e83

View file

@ -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<String> 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<String> 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()) {