mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Tests: enable warnings for wrong card texts in WAR set
This commit is contained in:
parent
cf02b842df
commit
5f07a9aff2
1 changed files with 17 additions and 9 deletions
|
|
@ -602,7 +602,7 @@ public class VerifyCardDataTest {
|
||||||
//checkNumbers(card, ref); // TODO: load data from allsets.json and check it (allcards.json do not have card numbers)
|
//checkNumbers(card, ref); // TODO: load data from allsets.json and check it (allcards.json do not have card numbers)
|
||||||
checkBasicLands(card, ref);
|
checkBasicLands(card, ref);
|
||||||
checkMissingAbilities(card, ref);
|
checkMissingAbilities(card, ref);
|
||||||
//checkWrongCosts(card, ref);
|
checkWrongAbilitiesText(card, ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkColors(Card card, JsonCard ref) {
|
private void checkColors(Card card, JsonCard ref) {
|
||||||
|
|
@ -734,13 +734,23 @@ public class VerifyCardDataTest {
|
||||||
card.getRules().stream().forEach(System.out::println);
|
card.getRules().stream().forEach(System.out::println);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkWrongCosts(Card card, JsonCard ref) {
|
private void checkWrongAbilitiesText(Card card, JsonCard ref) {
|
||||||
// checks missing or wrong cost
|
// checks missing or wrong text
|
||||||
if (!card.getExpansionSetCode().equals("RNA")) {
|
if (!card.getExpansionSetCode().equals("WAR")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] refRules = ref.text.split("[\\$\\\n]"); // ref card's abilities can be splited by \n or $ chars
|
if (ref.text == null || ref.text.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String refText = ref.text;
|
||||||
|
// lands fix
|
||||||
|
if (refText.startsWith("(") && refText.endsWith(")")) {
|
||||||
|
refText = refText.substring(1, refText.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] refRules = refText.split("[\\$\\\n]"); // ref card's abilities can be splited by \n or $ chars
|
||||||
for (int i = 0; i < refRules.length; i++) {
|
for (int i = 0; i < refRules.length; i++) {
|
||||||
refRules[i] = prepareRule(card.getName(), refRules[i]);
|
refRules[i] = prepareRule(card.getName(), refRules[i]);
|
||||||
}
|
}
|
||||||
|
|
@ -752,17 +762,15 @@ public class VerifyCardDataTest {
|
||||||
|
|
||||||
for (String cardRule : cardRules) {
|
for (String cardRule : cardRules) {
|
||||||
boolean isAbilityFounded = false;
|
boolean isAbilityFounded = false;
|
||||||
boolean isCostOk = false;
|
|
||||||
for (String refRule : refRules) {
|
for (String refRule : refRules) {
|
||||||
if (cardRule.equals(refRule)) {
|
if (cardRule.equals(refRule)) {
|
||||||
isAbilityFounded = true;
|
isAbilityFounded = true;
|
||||||
isCostOk = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isCostOk) {
|
if (!isAbilityFounded) {
|
||||||
fail(card, "abilities", "card ability have cost, but can't find in ref [" + "xxx" + ": " + card.getRules() + "]");
|
warn(card, "card ability can't be found in ref [" + card.getName() + ": " + cardRule + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue