Skip to content

Commit

Permalink
CLDR-16818 fix unclear test message about attributeValueValidity.xml
Browse files Browse the repository at this point in the history
- fix an internal function for clarity
- change a constant to a property
- [X] be less cryptic
- drop debug code
  • Loading branch information
srl295 committed Apr 19, 2024
1 parent 26de8b7 commit 97c0b19
Showing 1 changed file with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@

public class TestCoverageLevel extends TestFmwkPlus {

private static final boolean SHOW_LSR_DATA = false;
private static final boolean SHOW_LSR_DATA =
CLDRConfig.getInstance().getProperty("SHOW_LSR_DATA", false);

private static CLDRConfig testInfo = CLDRConfig.getInstance();
private static final StandardCodes STANDARD_CODES = StandardCodes.make();
Expand Down Expand Up @@ -1190,9 +1191,6 @@ public void testLSR() {
addBestLevel(scripts, ltp.getScript(), languageLevel);
addBestLevel(regions, ltp.getRegion(), languageLevel);
}
regions.remove("");
scripts.remove("");

// get the data

Map<String, CoverageStatus> data = new TreeMap<>();
Expand Down Expand Up @@ -1280,7 +1278,7 @@ public void testLSR() {
}
}
if (!assertEquals(
"Language subtags that are in a CLDR locale's ID are in root ("
"$language in attributeValueValidity.xml needs to include these languages: ("
+ missing.size()
+ ")",
"",
Expand All @@ -1306,17 +1304,9 @@ private String breakLines(Set<String> ids, String indent) {
}

private void addBestLevel(Map<String, Level> codeToBestLevel, String code, Level level) {
if (level != Level.UNDETERMINED) {
int debug = 0;
}
Level old = codeToBestLevel.get(code);
if (old == null) {
codeToBestLevel.put(code, level);
} else if (level.compareTo(old) > 0) {
codeToBestLevel.put(code, level);
} else if (level != old) {
int debug = 0;
}
if (code.isEmpty()) return; // ignore empty strings from tags such as ca__VALENCIA
final Level old = codeToBestLevel.get(code);
codeToBestLevel.put(code, Level.max(old, level));
}

public void TestEnglishCoverage() {
Expand Down

0 comments on commit 97c0b19

Please sign in to comment.