mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
tests: enabled some verify tests
This commit is contained in:
parent
2f35eb7fa6
commit
7d73f72e83
1 changed files with 19 additions and 12 deletions
|
|
@ -308,9 +308,6 @@ public class VerifyCardDataTest {
|
||||||
check(((CardWithHalves) card).getLeftHalfCard(), cardIndex);
|
check(((CardWithHalves) card).getLeftHalfCard(), cardIndex);
|
||||||
check(((CardWithHalves) card).getRightHalfCard(), cardIndex);
|
check(((CardWithHalves) card).getRightHalfCard(), cardIndex);
|
||||||
} else if (card instanceof CardWithSpellOption) {
|
} else if (card instanceof CardWithSpellOption) {
|
||||||
if (card.isLand()) { // temporary until scryfall fixes the mana cost issue for adventure lands
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
check(card, cardIndex);
|
check(card, cardIndex);
|
||||||
check(((CardWithSpellOption) card).getSpellCard(), cardIndex);
|
check(((CardWithSpellOption) card).getSpellCard(), cardIndex);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1129,9 +1126,6 @@ public class VerifyCardDataTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ExpansionSet.SetCardInfo card : set.getSetCardInfo()) {
|
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 cardHaveDoubleName = (doubleNames.getOrDefault(card.getName(), 0) > 1);
|
||||||
boolean cardHaveVariousSetting = card.getGraphicInfo() != null && card.getGraphicInfo().getUsesVariousArt();
|
boolean cardHaveVariousSetting = card.getGraphicInfo() != null && card.getGraphicInfo().getUsesVariousArt();
|
||||||
|
|
||||||
|
|
@ -1729,13 +1723,17 @@ public class VerifyCardDataTest {
|
||||||
return;
|
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<>();
|
Set<String> expected = new HashSet<>();
|
||||||
if (ref.colors != null) {
|
if (ref.colors != null) {
|
||||||
expected.addAll(ref.colors);
|
expected.addAll(ref.colors);
|
||||||
}
|
}
|
||||||
if (card.isFlipCard()) {
|
|
||||||
expected.addAll(ref.colorIdentity);
|
|
||||||
}
|
|
||||||
|
|
||||||
ObjectColor color = card.getColor(null);
|
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
|
// - it's can be a keyword action (only mtg rules contains a target word), so add it to the targetedKeywords
|
||||||
// * on "must be targeted":
|
// * on "must be targeted":
|
||||||
// - TODO: enable and research checkMissTargeted - too much errors with it (is it possible to use that checks?)
|
// - 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
|
boolean checkMissTargeted = false; // must be targeted
|
||||||
List<String> targetedKeywords = Arrays.asList(
|
List<String> targetedKeywords = Arrays.asList(
|
||||||
"target",
|
"target",
|
||||||
|
|
@ -2184,9 +2182,10 @@ public class VerifyCardDataTest {
|
||||||
"modular",
|
"modular",
|
||||||
"partner"
|
"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;
|
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();
|
additionalName = ((CardWithSpellOption) card).getSpellCard().getName();
|
||||||
} else if (card.isTransformable() && !card.isNightCard()) {
|
} else if (card.isTransformable() && !card.isNightCard()) {
|
||||||
additionalName = card.getSecondCardFace().getName();
|
additionalName = card.getSecondCardFace().getName();
|
||||||
|
|
@ -2204,6 +2203,7 @@ public class VerifyCardDataTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean needTargetedAbility = targetedKeywords.stream().anyMatch(refLowerText::contains);
|
boolean needTargetedAbility = targetedKeywords.stream().anyMatch(refLowerText::contains);
|
||||||
boolean foundTargetedAbility = card.getAbilities()
|
boolean foundTargetedAbility = card.getAbilities()
|
||||||
.stream()
|
.stream()
|
||||||
|
|
@ -2883,6 +2883,13 @@ public class VerifyCardDataTest {
|
||||||
return;
|
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 expected = ref.manaCost;
|
||||||
String cost = String.join("", card.getManaCostSymbols());
|
String cost = String.join("", card.getManaCostSymbols());
|
||||||
if (cost.isEmpty()) {
|
if (cost.isEmpty()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue