Tests: add new verify test to check wrong symbols in rules/names;

This commit is contained in:
Oleg Agafonov 2020-01-01 14:24:52 +04:00
parent fc8c7eb410
commit ed8c3276e1

View file

@ -401,7 +401,7 @@ public class VerifyCardDataTest {
doubleNames.put(card.getName(), count + 1);
}
// check
// check double names
for (ExpansionSet.SetCardInfo card : set.getSetCardInfo()) {
boolean cardHaveDoubleName = (doubleNames.getOrDefault(card.getName(), 0) > 1);
boolean cardHaveVariousSetting = card.getGraphicInfo() != null && card.getGraphicInfo().getUsesVariousArt();
@ -624,6 +624,7 @@ public class VerifyCardDataTest {
//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);
checkWrongSymbolsInRules(card);
checkWrongAbilitiesText(card, ref);
}
@ -728,6 +729,18 @@ public class VerifyCardDataTest {
}
}
private void checkWrongSymbolsInRules(Card card) {
if (card.getName().contains("")) {
fail(card, "card name", "card's names contains restricted symbol ");
}
for (String rule : card.getRules()) {
if (rule.contains("")) {
fail(card, "rules", "card's rules contains restricted symbol ");
}
}
}
private void checkLegalityFormats(Card card, JsonCard ref) {
if (skipListHaveName("LEGALITY", card.getExpansionSetCode(), card.getName())) {
return;