mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Add Verify test to detect that copy of a Card throws an Exception (#10752)
* Add test to detect a copy loop on all the Card in the CardRepository * reword messages * move copy test in verify checks * catch any kind of error
This commit is contained in:
parent
5c58e28f9b
commit
b04b13d530
1 changed files with 10 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ public class VerifyCardDataTest {
|
|||
|
||||
private static final Logger logger = Logger.getLogger(VerifyCardDataTest.class);
|
||||
|
||||
private static final String FULL_ABILITIES_CHECK_SET_CODES = "LTR;LTC"; // check ability text due mtgjson, can use multiple sets like MAT;CMD or * for all
|
||||
private static final String FULL_ABILITIES_CHECK_SET_CODES = "LTR;LTC;CMM"; // check ability text due mtgjson, can use multiple sets like MAT;CMD or * for all
|
||||
private static final boolean CHECK_ONLY_ABILITIES_TEXT = false; // use when checking text locally, suppresses unnecessary checks and output messages
|
||||
|
||||
private static final boolean AUTO_FIX_SAMPLE_DECKS = false; // debug only: auto-fix sample decks by test_checkSampleDecks test run
|
||||
|
|
@ -1606,6 +1606,7 @@ public class VerifyCardDataTest {
|
|||
checkBasicLands(card, ref);
|
||||
checkMissingAbilities(card, ref);
|
||||
checkWrongSymbolsInRules(card);
|
||||
checkCardCanBeCopied(card);
|
||||
}
|
||||
checkWrongAbilitiesText(card, ref, cardIndex);
|
||||
}
|
||||
|
|
@ -1635,6 +1636,14 @@ public class VerifyCardDataTest {
|
|||
}
|
||||
}
|
||||
|
||||
private void checkCardCanBeCopied(Card card) {
|
||||
try {
|
||||
Card card2 = card.copy();
|
||||
} catch (Error err) {
|
||||
fail(card, "copy", "throws on copy : " + err.getClass() + " : " + err.getMessage() + " : ");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkSubtypes(Card card, MtgJsonCard ref) {
|
||||
if (skipListHaveName(SKIP_LIST_SUBTYPE, card.getExpansionSetCode(), card.getName())) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue