diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index 27d780138ff..02b9486cfc3 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -82,6 +82,9 @@ public class VerifyCardDataTest { // number skipListCreate("NUMBER"); + + // missing abilities + skipListCreate("MISSING_ABILITIES"); } public static List allCards() { @@ -440,6 +443,7 @@ public class VerifyCardDataTest { checkColors(card, ref); //checkNumbers(card, ref); // TODO: load data from allsets.json and check it (allcards.json do not have card numbers) checkBasicLands(card, ref); + checkMissingAbilities(card, ref); } private void checkColors(Card card, JsonCard ref) { @@ -472,7 +476,7 @@ public class VerifyCardDataTest { // fix names (e.g. Urza’s to Urza's) if (expected != null && expected.contains("Urza’s")) { expected = new ArrayList<>(expected); - for (ListIterator it = ((List) expected).listIterator(); it.hasNext();) { + for (ListIterator it = ((List) expected).listIterator(); it.hasNext(); ) { if (it.next().equals("Urza’s")) { it.set("Urza's"); } @@ -510,6 +514,33 @@ public class VerifyCardDataTest { } } + private void checkMissingAbilities(Card card, JsonCard ref) { + if (skipListHaveName("MISSING_ABILITIES", card.getName())) { + return; + } + + // search missing abilities from card source + + if (ref.text == null || ref.text.isEmpty()) { + return; + } + + // spells have only 1 abilities + if (card.isSorcery() || card.isInstant()) { + return; + } + + // additional cost go to 1 ability + if (ref.text.startsWith("As an additional cost to cast")) { + return; + } + + // always 1 ability (to cast) + if (card.getAbilities().toArray().length == 1) { // all cards have 1 inner ability to cast + fail(card, "abilities", "card's abilities is empty, but ref have text"); + } + } + private static boolean eqSet(Collection a, Collection b) { if (a == null || a.isEmpty()) { return b == null || b.isEmpty();