mirror of
https://github.com/correl/mage.git
synced 2025-04-10 01:01:05 -09:00
Tests: improved verify checks for missing/wrong abilities
This commit is contained in:
parent
ec93f50bab
commit
2de535feb2
1 changed files with 27 additions and 3 deletions
|
@ -728,12 +728,15 @@ public class VerifyCardDataTest {
|
||||||
String newRule = rule;
|
String newRule = rule;
|
||||||
|
|
||||||
// remove reminder text
|
// remove reminder text
|
||||||
newRule = newRule.replaceAll("(?i)<i>\\(.+\\)</i>", "");
|
newRule = newRule.replaceAll("(?i) <i>\\(.+\\)</i>", "");
|
||||||
|
newRule = newRule.replaceAll("(?i) \\(.+\\)", "");
|
||||||
|
|
||||||
// replace special text and symbols
|
// replace special text and symbols
|
||||||
newRule = newRule
|
newRule = newRule
|
||||||
.replace("{this}", cardName)
|
.replace("{this}", cardName)
|
||||||
.replace("—", "—");
|
.replace("{source}", cardName)
|
||||||
|
.replace("−", "-")
|
||||||
|
.replace("—", "-");
|
||||||
|
|
||||||
// remove html marks
|
// remove html marks
|
||||||
newRule = newRule
|
newRule = newRule
|
||||||
|
@ -757,7 +760,7 @@ public class VerifyCardDataTest {
|
||||||
|
|
||||||
private void checkWrongAbilitiesText(Card card, JsonCard ref) {
|
private void checkWrongAbilitiesText(Card card, JsonCard ref) {
|
||||||
// checks missing or wrong text
|
// checks missing or wrong text
|
||||||
if (!card.getExpansionSetCode().equals("MH1")) {
|
if (!card.getExpansionSetCode().equals("M20")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -781,6 +784,7 @@ public class VerifyCardDataTest {
|
||||||
cardRules[i] = prepareRule(card.getName(), cardRules[i]);
|
cardRules[i] = prepareRule(card.getName(), cardRules[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isFine = true;
|
||||||
for (String cardRule : cardRules) {
|
for (String cardRule : cardRules) {
|
||||||
boolean isAbilityFounded = false;
|
boolean isAbilityFounded = false;
|
||||||
for (String refRule : refRules) {
|
for (String refRule : refRules) {
|
||||||
|
@ -791,9 +795,29 @@ public class VerifyCardDataTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isAbilityFounded) {
|
if (!isAbilityFounded) {
|
||||||
|
isFine = false;
|
||||||
warn(card, "card ability can't be found in ref [" + card.getName() + ": " + cardRule + "]");
|
warn(card, "card ability can't be found in ref [" + card.getName() + ": " + cardRule + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// extra message for easy checks
|
||||||
|
if (!isFine) {
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
System.out.println("Wrong card " + card.getName());
|
||||||
|
Arrays.sort(cardRules);
|
||||||
|
for (String s : cardRules) {
|
||||||
|
System.out.println(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("ref:");
|
||||||
|
Arrays.sort(refRules);
|
||||||
|
for (String s : refRules) {
|
||||||
|
System.out.println(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue