diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CldrVersion.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CldrVersion.java index 036f2211c45..ab7f4189e9f 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CldrVersion.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CldrVersion.java @@ -72,6 +72,7 @@ public enum CldrVersion { v46_0, v46_1, v47_0, + v48_0, /** * @see CLDRFile#GEN_VERSION */ diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ToolConstants.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ToolConstants.java index 87002d32d04..a0985fa7e23 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ToolConstants.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ToolConstants.java @@ -31,7 +31,7 @@ public enum ChartStatus { "1.7.2", "1.8.1", "1.9.1", "2.0.1", "21.0", "22.1", "23.1", "24.0", "25.0", "26.0", "27.0", "28.0", "29.0", "30.0", "31.0", "32.0", "33.0", "33.1", "34.0", "35.0", "35.1", "36.0", "36.1", "37.0", "38.0", "38.1", "39.0", "40.0", "41.0", - "42.0", "43.0", "44.0", "44.1", "45.0", "46.0", "46.1", "47.0" + "42.0", "43.0", "44.0", "44.1", "45.0", "46.0", "46.1", "47.0", "48.0" // add to this once the release is final! ); public static final Set CLDR_VERSIONS_VI = diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCoverageLevel2.java b/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCoverageLevel2.java index b6ae03431f2..a0171185eca 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCoverageLevel2.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCoverageLevel2.java @@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; +import com.google.common.collect.ImmutableSet; import com.ibm.icu.util.VersionInfo; import java.io.IOException; import java.util.HashMap; @@ -211,6 +212,31 @@ private void collectMissingTypes( } } + /** + * @param knownIssue issue ID such as CLDR-18968 + * @param setToModify the notInEnglish or notInCoverage set to check and modify + * @param message message to include in the known issue (giving context) + * @param setToExclude the list of excluded locales + * @returns true if anything was removed + */ + private boolean removeIfKnownIssue( + final String knownIssue, + Set setToModify, + final String message, + final Set setToExclude) { + final Set toRemove = new TreeSet<>(setToModify); + toRemove.retainAll(setToExclude); + if (!toRemove.isEmpty()) { + if (logKnownIssue( + knownIssue, + String.format("Excluding: %s from %s", toRemove.toString(), message))) { + setToModify.removeAll(toRemove); + return true; + } + } + return false; // no changes + } + /** Bring the bad news (if any). Reporting factored out here. */ private void assertMissingCoverage( final Level failIfAbove, @@ -221,25 +247,43 @@ private void assertMissingCoverage( // given xpp is scripts/script or languages/language, etc. final String plural = xpp.getElement(-2); // the plural form of what we're looking for Assertions.assertAll( - () -> - assertTrue( - notInEnglish.isEmpty(), - () -> - String.format( - "en.xml missing these %s: %s", - plural, notInEnglish.toString())), () -> { + assertTrue( + notInEnglish.isEmpty(), + () -> + String.format( + "en.xml missing these %s: %s", + plural, notInEnglish.toString())); + }, + () -> { + // make a modifyable copy here so we can exclude some due to logKnownIssues + Set remainingNotInCoverage = new TreeSet<>(notInCoverage); final Supplier formatter = () -> String.format( "coverageLevels.xml has level > %s for these %s: %s", - failIfAbove, plural, notInCoverage.toString()); - if (!notInCoverage.isEmpty() && plural.equals("variants")) { - if (logKnownIssue("CLDR-18480", formatter.get())) { - return; + failIfAbove, plural, remainingNotInCoverage.toString()); + // handle known issues here + if (!remainingNotInCoverage.isEmpty()) { + if (plural.equals("variants") + && logKnownIssue("CLDR-18480", formatter.get())) { + remainingNotInCoverage.clear(); + } else if (plural.equals("languages")) { + // Can add known issues here, + // add multiple lines as below: + // + // removeIfKnownIssue("CLDR-00000", remainingNotInCoverage, message, + // ImmutableSet.of("es","tlh","zxx")); + + removeIfKnownIssue( + "CLDR-18972", + remainingNotInCoverage, + formatter.get(), + ImmutableSet.of("ba", "bua", "pms", "scn", "shn", "tyv")); } + // do the assertion. + assertTrue(remainingNotInCoverage.isEmpty(), formatter); } - assertTrue(notInCoverage.isEmpty(), formatter); }); } }