Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17726 make TestTransform.TestLocales less obscure #3803

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading