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-11155 Pages too big: revise test for large pages #3573

Merged
merged 1 commit into from
Apr 3, 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 @@ -1684,14 +1684,14 @@ public void testPageSize() {
final long minError = 946; // above this, emit error
final long minLog = 700; // otherwise above this, emit warning
Factory factory = CLDRConfig.getInstance().getCommonAndSeedAndMainAndAnnotationsFactory();
// "en", "cs", "ar", "pl"
List<String> locales =
StandardCodes.make()
.getLocaleCoverageLocales(Organization.cldr, ImmutableSet.of(Level.MODERN))
.stream()
.filter(x -> CLDRLocale.getInstance(x).getCountry().isEmpty())
.collect(Collectors.toUnmodifiableList());
List<Counter<PageId>> counters = new ArrayList<>();
final String thresholdExplanation = "log/error thresholds are " + minLog + "/" + minError;
for (String locale : locales) {
CLDRFile cldrFile = factory.make(locale, false);
PathHeader.Factory phf = PathHeader.getFactory();
Expand All @@ -1703,23 +1703,20 @@ public void testPageSize() {
}
for (PageId entry : c.getKeysetSortedByKey()) {
long count = c.getCount(entry);
if (count > minError) {
errln(
locale
+ "\t"
+ entry.getSectionId()
+ "\t"
+ entry
+ "\thas too many entries:\t"
+ count);
} else if (count > minLog) {
warnln(
locale
+ "\t"
+ entry.getSectionId()
+ "\t"
+ "\thas too many entries:\t"
+ count);
if (count > minLog) {
final String message =
String.format(
"%s\t%s\t%s\thas too many entries:\t%d\t(%s)",
locale,
entry.getSectionId().toString(),
entry,
count,
thresholdExplanation);
if (count > minError) {
errln(message);
} else {
warnln(message);
}
}
}
}
Expand Down
Loading