Skip to content

Commit

Permalink
CLDR-17726 make TestTransform.TestLocales less obscure (#3803)
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 authored Jun 17, 2024
1 parent 3766112 commit 79eb09c
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.unicode.cldr.draft.FileUtilities;
import org.unicode.cldr.tool.LikelySubtags;
import org.unicode.cldr.util.CLDRConfig;
Expand Down Expand Up @@ -860,6 +861,8 @@ public void TestLocales() {
CLDRTransforms.getInstance().registerModified();
}

Set<Pair<String, String>> badLocaleScript = new TreeSet<>();

for (String locale : modernCldr) {
if (special.contains(locale)) {
continue;
Expand Down Expand Up @@ -900,6 +903,7 @@ public void TestLocales() {
+ " code points:\n"
+ badPlusSample);
allMissing.addAll(badPlusSample);
badLocaleScript.add(Pair.of(locale, script));
}
}
if (!allMissing.isEmpty()) {
Expand All @@ -924,6 +928,11 @@ public void TestLocales() {
+ allMissing.dataSet.keySet());
for (String script : allMissing.scriptMissing.values()) {
UnicodeSet missingFoScript = allMissing.scriptMissing.getKeys(script);
String localeForScript =
badLocaleScript.stream()
.filter(p -> p.getSecond().equals((script)))
.map(p -> p.getFirst())
.collect(Collectors.joining(","));
errln(
"Transliterator for\t"
+ script
Expand All @@ -932,7 +941,9 @@ public void TestLocales() {
+ ":\t"
+ missingFoScript.toPattern(false)
+ "="
+ missingFoScript);
+ missingFoScript
+ " - needed for locales: "
+ localeForScript);
}
}
}
Expand Down

0 comments on commit 79eb09c

Please sign in to comment.