verify test: ref text adjustments to remove some false positives

This commit is contained in:
xenohedron 2024-02-15 20:23:50 -05:00
parent 19dd9ea1b8
commit 9a4f935f07

View file

@ -97,7 +97,8 @@ public class VerifyCardDataTest {
private static final List<String> evergreenKeywords = Arrays.asList(
"flying", "lifelink", "menace", "trample", "haste", "first strike", "hexproof", "fear",
"deathtouch", "double strike", "indestructible", "reach", "flash", "defender", "vigilance",
"plainswalk", "islandwalk", "swampwalk", "mountainwalk", "forestwalk", "myriad", "prowess", "convoke"
"plainswalk", "islandwalk", "swampwalk", "mountainwalk", "forestwalk", "myriad", "prowess", "convoke",
"shroud", "banding", "flanking", "horsemanship", "legendary landwalk"
);
private static final List<String> doubleWords = new ArrayList<>();
@ -269,8 +270,12 @@ public class VerifyCardDataTest {
return skipListGet(listName).contains(set);
}
/**
* For splitting printed rules text with multiple keywords on one line
*/
private static boolean evergreenCheck(String s) {
return evergreenKeywords.contains(s) || s.startsWith("protection from") || s.startsWith("hexproof from") || s.startsWith("ward ");
return evergreenKeywords.contains(s) || s.startsWith("protection from") || s.startsWith("hexproof from")
|| s.startsWith("ward ") || s.startsWith("rampage ") || s.startsWith("annihilator");
}
private static <T> boolean eqSet(Collection<T> a, Collection<T> b) {
@ -2304,11 +2309,11 @@ public class VerifyCardDataTest {
private void checkWrongAbilitiesTextEnd() {
// TODO: implement tests result/stats by github actions to show in check message compared to prev version
System.out.println(String.format(""));
System.out.println(String.format("Stats for %d cards checked for abilities text:", wrongAbilityStatsTotal));
System.out.println(String.format(" - Cards with correct text: %5d (%.2f)", wrongAbilityStatsGood, wrongAbilityStatsGood * 100.0 / wrongAbilityStatsTotal));
System.out.println(String.format(" - Cards with text errors: %5d (%.2f)", wrongAbilityStatsBad, wrongAbilityStatsBad * 100.0 / wrongAbilityStatsTotal));
System.out.println(String.format(""));
System.out.println();
System.out.printf("Stats for %d cards checked for abilities text:%n", wrongAbilityStatsTotal);
System.out.printf(" - Cards with correct text: %5d (%.2f)%n", wrongAbilityStatsGood, wrongAbilityStatsGood * 100.0 / wrongAbilityStatsTotal);
System.out.printf(" - Cards with text errors: %5d (%.2f)%n", wrongAbilityStatsBad, wrongAbilityStatsBad * 100.0 / wrongAbilityStatsTotal);
System.out.println();
}
private void checkWrongAbilitiesText(Card card, MtgJsonCard ref, int cardIndex) {
@ -2380,15 +2385,11 @@ public class VerifyCardDataTest {
if (ref.subtypes.contains("Adventure")) {
for (int i = 0; i < refRules.length; i++) {
refRules[i] = new StringBuilder("Adventure ")
.append(ref.types.get(0))
.append(" - ")
.append(ref.faceName)
.append(' ')
.append(ref.manaCost)
.append(" - ")
.append(refRules[i])
.toString();
refRules[i] = "Adventure " +
ref.types.get(0) + " - " +
ref.faceName + ' ' +
ref.manaCost + " - " +
refRules[i];
}
}