mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
tests: added ref rules compare in test_showCardInfo
This commit is contained in:
parent
1568189c1b
commit
a29dbc17eb
1 changed files with 23 additions and 16 deletions
|
|
@ -1696,7 +1696,7 @@ public class VerifyCardDataTest {
|
||||||
checkCardCanBeCopied(card);
|
checkCardCanBeCopied(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkWrongAbilitiesText(card, ref, cardIndex);
|
checkWrongAbilitiesText(card, ref, cardIndex, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkColors(Card card, MtgJsonCard ref) {
|
private void checkColors(Card card, MtgJsonCard ref) {
|
||||||
|
|
@ -2416,24 +2416,31 @@ public class VerifyCardDataTest {
|
||||||
|
|
||||||
// ref card
|
// ref card
|
||||||
System.out.println();
|
System.out.println();
|
||||||
MtgJsonCard ref = MtgJsonService.card(card.getName());
|
MtgJsonCard refMain = MtgJsonService.card(card.getName());
|
||||||
MtgJsonCard ref2 = null;
|
MtgJsonCard refSpell = null;
|
||||||
if (card instanceof CardWithSpellOption) {
|
if (card instanceof CardWithSpellOption) {
|
||||||
ref2 = MtgJsonService.card(((CardWithSpellOption) card).getSpellCard().getName());
|
refSpell = MtgJsonService.card(((CardWithSpellOption) card).getSpellCard().getName());
|
||||||
}
|
}
|
||||||
if (ref == null) {
|
if (refMain == null) {
|
||||||
ref = MtgJsonService.cardByClassName(foundClassName);
|
refMain = MtgJsonService.cardByClassName(foundClassName);
|
||||||
}
|
}
|
||||||
if (ref != null) {
|
if (refMain != null) {
|
||||||
System.out.println("ref: " + ref.getNameAsFace() + " " + ref.manaCost);
|
System.out.println("ref: " + refMain.getNameAsFace() + " " + refMain.manaCost);
|
||||||
System.out.println(ref.text);
|
System.out.println(refMain.text);
|
||||||
if (ref2 != null) {
|
if (refSpell != null) {
|
||||||
System.out.println(ref2.getNameAsFace() + " " + ref2.manaCost);
|
System.out.println(refSpell.getNameAsFace() + " " + refSpell.manaCost);
|
||||||
System.out.println(ref2.text);
|
System.out.println(refSpell.text);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("WARNING, can't find mtgjson ref for " + card.getName());
|
System.out.println("WARNING, can't find mtgjson ref for " + card.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// additional check to simulate diff in rules
|
||||||
|
if (refMain != null) {
|
||||||
|
checkWrongAbilitiesText(card, refMain, 0, true);
|
||||||
|
} else if (refSpell != null) {
|
||||||
|
checkWrongAbilitiesText(((CardWithSpellOption) card).getSpellCard(), refSpell, 0, true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2484,9 +2491,9 @@ public class VerifyCardDataTest {
|
||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkWrongAbilitiesText(Card card, MtgJsonCard ref, int cardIndex) {
|
private void checkWrongAbilitiesText(Card card, MtgJsonCard ref, int cardIndex, boolean forceToCheck) {
|
||||||
// checks missing or wrong text
|
// checks missing or wrong text
|
||||||
if (!FULL_ABILITIES_CHECK_SET_CODES.equals("*") && !FULL_ABILITIES_CHECK_SET_CODES.contains(card.getExpansionSetCode())) {
|
if (!forceToCheck && !FULL_ABILITIES_CHECK_SET_CODES.equals("*") && !FULL_ABILITIES_CHECK_SET_CODES.contains(card.getExpansionSetCode())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (wasCheckedByAbilityText(ref)) {
|
if (wasCheckedByAbilityText(ref)) {
|
||||||
|
|
@ -2628,10 +2635,10 @@ public class VerifyCardDataTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
// extra message for easy checks
|
// extra message for easy checks
|
||||||
if (!isFine) {
|
if (forceToCheck || !isFine) {
|
||||||
System.out.println();
|
System.out.println();
|
||||||
|
|
||||||
System.out.println("Wrong card " + cardIndex + ": " + card.getName());
|
System.out.println((isFine ? "Good" : "Wrong") + " card " + cardIndex + ": " + card.getName());
|
||||||
Arrays.sort(cardRules);
|
Arrays.sort(cardRules);
|
||||||
for (String s : cardRules) {
|
for (String s : cardRules) {
|
||||||
System.out.println(s);
|
System.out.println(s);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue