From 2779f81764556bce8f34ea12b71abe035b698cd0 Mon Sep 17 00:00:00 2001 From: Neil Gentleman Date: Sun, 16 Oct 2016 12:02:13 -0700 Subject: [PATCH] remove tests without assertions - source token checking is very noisy, so disabled it for now - set verification wasn't showing anything interesting --- .../java/mage/verify/VerifyCardDataTest.java | 44 +++---------------- 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index 055ba315ab0..0fe8f7b7418 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -23,42 +23,8 @@ import java.util.regex.Pattern; public class VerifyCardDataTest { - @Test - public void verifySets() throws IOException { - Map reference = MtgJson.sets(); - - for (ExpansionSet set : Sets.getInstance().values()) { - JsonSet ref = reference.get(set.getCode()); - if (ref == null) { - for (JsonSet js : reference.values()) { - if (set.getCode().equals(js.oldCode) || set.getCode().toLowerCase().equals(js.magicCardsInfoCode)) { - ref = js; - break; - } - } - if (ref == null) { - System.out.println("missing reference for " + set); - continue; - } - } - if (!String.format("%tF", set.getReleaseDate()).equals(ref.releaseDate)) { - System.out.printf("%40s %-20s %20tF %20s%n", set, "release date", set.getReleaseDate(), ref.releaseDate); - } - if (set.hasBoosters() != (ref.booster != null)) { - System.out.printf("%40s %-20s %20s %20s%n", set, "has boosters", set.hasBoosters(), ref.booster != null); - } - boolean refHasBasicLands = false; - for (JsonCard card : ref.cards) { - if ("Mountain".equals(card.name)) { - refHasBasicLands = true; - break; - } - } - if (set.hasBasicLands() != refHasBasicLands) { - System.out.printf("%40s %-20s %20s %20s%n", set, "has basic lands", set.hasBasicLands(), refHasBasicLands); - } - } - } + // right now this is very noisy, and not useful enough to make any assertions on + private static final boolean CHECK_SOURCE_TOKENS = false; public static List allCards() { Collection sets = Sets.getInstance().values(); @@ -105,8 +71,8 @@ public class VerifyCardDataTest { private static final Pattern SHORT_JAVA_STRING = Pattern.compile("(?<=\")[A-Z][a-z]+(?=\")"); private Set findSourceTokens(Class c) throws IOException { - if (BasicLand.class.isAssignableFrom(c)) { - return Collections.emptySet(); + if (!CHECK_SOURCE_TOKENS || BasicLand.class.isAssignableFrom(c)) { + return null; } String path = "../Mage.Sets/src/" + c.getName().replace(".", "/") + ".java"; try { @@ -119,7 +85,7 @@ public class VerifyCardDataTest { return tokens; } catch (NoSuchFileException e) { System.out.println("failed to read " + path); - return Collections.emptySet(); + return null; } }