mirror of
https://github.com/correl/mage.git
synced 2024-12-28 11:14:13 +00:00
Tests: added verify check for wrong set names (disabled until 40k cards merge)
This commit is contained in:
parent
202f3687e9
commit
59d2b59a4f
1 changed files with 20 additions and 2 deletions
|
@ -877,8 +877,8 @@ public class VerifyCardDataTest {
|
||||||
|
|
||||||
// CHECK: wrong basic lands settings (it's for lands search, not booster construct)
|
// CHECK: wrong basic lands settings (it's for lands search, not booster construct)
|
||||||
for (ExpansionSet set : sets) {
|
for (ExpansionSet set : sets) {
|
||||||
Boolean needLand = set.hasBasicLands();
|
boolean needLand = set.hasBasicLands();
|
||||||
Boolean foundLand = false;
|
boolean foundLand = false;
|
||||||
Map<String, Integer> foundLandsList = new HashMap<>();
|
Map<String, Integer> foundLandsList = new HashMap<>();
|
||||||
for (ExpansionSet.SetCardInfo card : set.getSetCardInfo()) {
|
for (ExpansionSet.SetCardInfo card : set.getSetCardInfo()) {
|
||||||
if (isBasicLandName(card.getName())) {
|
if (isBasicLandName(card.getName())) {
|
||||||
|
@ -924,6 +924,24 @@ public class VerifyCardDataTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CHECK: wrong set name
|
||||||
|
for (ExpansionSet set : sets) {
|
||||||
|
if (true) continue; // TODO: enable after merge of 40k's cards pull requests (needs before set rename)
|
||||||
|
MtgJsonSet jsonSet = MtgJsonService.sets().getOrDefault(set.getCode().toUpperCase(Locale.ENGLISH), null);
|
||||||
|
if (jsonSet == null) {
|
||||||
|
// unofficial or inner set
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(set.getName(), jsonSet.name)) {
|
||||||
|
// how-to fix: rename xmage set to the json version or fix a set's code
|
||||||
|
// also don't forget to change names in mtg-cards-data.txt
|
||||||
|
errorsList.add(String.format("Error: wrong set name or set code: %s (mtgjson set for same code: %s)",
|
||||||
|
set.getCode() + " - " + set.getName(),
|
||||||
|
jsonSet.name
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: add test to check num cards for rarity (rarityStats > 0 and numRarity > 0)
|
// TODO: add test to check num cards for rarity (rarityStats > 0 and numRarity > 0)
|
||||||
printMessages(warningsList);
|
printMessages(warningsList);
|
||||||
printMessages(errorsList);
|
printMessages(errorsList);
|
||||||
|
|
Loading…
Reference in a new issue